chore: adapt ISO /etc/issue to new structure

This commit is contained in:
Swarsel 2024-12-24 16:11:57 +01:00
parent ae63e40f04
commit fbb8e23461
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
5 changed files with 47 additions and 50 deletions

View file

@ -1842,8 +1842,8 @@ For added convenience, the live environment displays a helpful text on login, we
~SwarselSystems~ ~SwarselSystems~
IP of primary interface: \4 IP of primary interface: \4
The Password for all users & root is 'setup'. The Password for all users & root is 'setup'.
Install the system remotely by running 'bootstrap -n <HOSTNAME> -d <IP_FROM_ABOVE> [--impermanence] [--encryption]' on a machine with deployed secrets. Install the system remotely by running 'bootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> ' on a machine with deployed secrets.
Alternatively, run 'swarsel-install -d <DISK> -f <flake>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access). Alternatively, run 'swarsel-install -d <DISK> -n <CONFIGURATION_NAME>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).
#+end_src #+end_src
@ -2770,7 +2770,7 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s
:CUSTOM_ID: h:74db57ae-0bb9-4257-84be-eddbc85130dd :CUSTOM_ID: h:74db57ae-0bb9-4257-84be-eddbc85130dd
:END: :END:
This program sets up a new NixOS host. This program sets up a new NixOS host remotely. It also takes care of secret management on the new host.
#+begin_src shell :tangle scripts/bootstrap.sh #+begin_src shell :tangle scripts/bootstrap.sh
# highly inspired by https://github.com/EmergentMind/nix-config/blob/dev/scripts/bootstrap-nixos.sh # highly inspired by https://github.com/EmergentMind/nix-config/blob/dev/scripts/bootstrap-nixos.sh
@ -2786,7 +2786,7 @@ This program sets up a new NixOS host.
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Remotely installs SwarselSystem on a target machine including secret deployment."
echo echo
echo "USAGE: $0 -n <target_hostname> -d <target_destination> [OPTIONS]" echo "USAGE: $0 -n <target_hostname> -d <target_destination> [OPTIONS]"
echo echo
@ -3085,11 +3085,6 @@ This program sets up a new NixOS host.
fi fi
#+end_src #+end_src
#+RESULTS:
| trap: | undefined | signal: | exit | | | | |
| [ | Babel | evaluation | exited | with | code | 1 | ] |
#+begin_src nix :tangle pkgs/bootstrap/default.nix #+begin_src nix :tangle pkgs/bootstrap/default.nix
{ writeShellApplication, openssh }: { writeShellApplication, openssh }:
@ -3103,22 +3098,22 @@ This program sets up a new NixOS host.
**** swarsel-rebuild **** swarsel-rebuild
This program sets up a new NixOS host. This program builds a configuration locally.
#+begin_src shell :tangle scripts/swarsel-rebuild.sh #+begin_src shell :tangle scripts/swarsel-rebuild.sh
set -eo pipefail set -eo pipefail
target_flake="chaostheatre" target_config="chaostheatre"
target_user="swarsel" target_user="swarsel"
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Builds SwarselSystem configuration."
echo echo
echo "USAGE: $0 [OPTIONS]" echo "USAGE: $0 [OPTIONS]"
echo echo
echo "ARGS:" echo "ARGS:"
echo " -f <target_flake> specify flake to deploy the nixos config of." echo " -n <target_config> specify nixos config to build."
echo " Default: chaostheatre" echo " Default: chaostheatre"
echo " -u <target_user> specify user to deploy for." echo " -u <target_user> specify user to deploy for."
echo " Default: swarsel" echo " Default: swarsel"
@ -3147,9 +3142,9 @@ This program sets up a new NixOS host.
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-f) -n)
shift shift
target_flake=$1 target_config=$1
;; ;;
-u) -u)
shift shift
@ -3187,11 +3182,11 @@ This program sets up a new NixOS host.
else else
green "Valid SSH key found! Continuing with installation" green "Valid SSH key found! Continuing with installation"
fi fi
sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/ sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.nix git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix
green "Installing flake $target_flake" green "Installing flake $target_config"
sudo nixos-rebuild --show-trace --flake .#"$target_flake" boot sudo nixos-rebuild --show-trace --flake .#"$target_config" boot
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly." yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."
#+end_src #+end_src
@ -3209,25 +3204,26 @@ This program sets up a new NixOS host.
**** swarsel-install **** swarsel-install
This program sets up a new NixOS host. This program sets up a new NixOS host locally.
#+begin_src shell :tangle scripts/swarsel-install.sh #+begin_src shell :tangle scripts/swarsel-install.sh
set -eo pipefail set -eo pipefail
target_flake="chaostheatre" target_config="chaostheatre"
target_user="swarsel" target_user="swarsel"
fs_type="ext4" fs_type="ext4"
disk="" disk=""
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Locally installs SwarselSystem on this machine."
echo echo
echo "USAGE: $0 -d <disk> [OPTIONS]" echo "USAGE: $0 -d <disk> [OPTIONS]"
echo echo
echo "ARGS:" echo "ARGS:"
echo " -d <disk> specify disk to install on." echo " -d <disk> specify disk to install on."
echo " -f <target_flake> specify flake to deploy the nixos config of." echo " -n <target_config> specify the nixos config to deploy."
echo " Default: chaostheatre"
echo " Default: chaostheatre" echo " Default: chaostheatre"
echo " -u <target_user> specify user to deploy for." echo " -u <target_user> specify user to deploy for."
echo " Default: swarsel" echo " Default: swarsel"
@ -3252,9 +3248,9 @@ This program sets up a new NixOS host.
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-f) -n)
shift shift
target_flake=$1 target_config=$1
;; ;;
-u) -u)
shift shift
@ -3316,15 +3312,15 @@ This program sets up a new NixOS host.
sudo mount "$disk"2 /mnt sudo mount "$disk"2 /mnt
sudo mkdir -p /mnt/boot sudo mkdir -p /mnt/boot
sudo mount "$disk"1 /mnt/boot sudo mount "$disk"1 /mnt/boot
sudo nixos-generate-config --root /mnt --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/ sudo nixos-generate-config --root /mnt --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.nix git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix
# sudo rm -rf /root/.nix-defexpr/channels # sudo rm -rf /root/.nix-defexpr/channels
# sudo rm -rf /nix/var/nix/profiles/per-user/channels # sudo rm -rf /nix/var/nix/profiles/per-user/channels
sudo mkdir -p /root/.local/share/nix/ sudo mkdir -p /root/.local/share/nix/
printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null
green "Installing flake $target_flake" green "Installing flake $target_config"
sudo nixos-install --flake .#"$target_flake" sudo nixos-install --flake .#"$target_config"
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly." yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."
green "Installation finished! Reboot to see changes" green "Installation finished! Reboot to see changes"
#+end_src #+end_src

View file

@ -1,5 +1,5 @@
~SwarselSystems~ ~SwarselSystems~
IP of primary interface: \4 IP of primary interface: \4
The Password for all users & root is 'setup'. The Password for all users & root is 'setup'.
Install the system remotely by running 'bootstrap -n <HOSTNAME> -d <IP_FROM_ABOVE> [--impermanence] [--encryption]' on a machine with deployed secrets. Install the system remotely by running 'bootstrap -n <CONFIGURATION_NAME> -d <IP_FROM_ABOVE> ' on a machine with deployed secrets.
Alternatively, run 'swarsel-install -d <DISK> -f <flake>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access). Alternatively, run 'swarsel-install -d <DISK> -n <CONFIGURATION_NAME>' for a local install. For your convenience, an example call is in the bash history (press up on the keyboard to access).

View file

@ -11,7 +11,7 @@ temp=$(mktemp -d)
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Remotely installs SwarselSystem on a target machine including secret deployment."
echo echo
echo "USAGE: $0 -n <target_hostname> -d <target_destination> [OPTIONS]" echo "USAGE: $0 -n <target_hostname> -d <target_destination> [OPTIONS]"
echo echo

View file

@ -1,19 +1,20 @@
set -eo pipefail set -eo pipefail
target_flake="chaostheatre" target_config="chaostheatre"
target_user="swarsel" target_user="swarsel"
fs_type="ext4" fs_type="ext4"
disk="" disk=""
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Locally installs SwarselSystem on this machine."
echo echo
echo "USAGE: $0 -d <disk> [OPTIONS]" echo "USAGE: $0 -d <disk> [OPTIONS]"
echo echo
echo "ARGS:" echo "ARGS:"
echo " -d <disk> specify disk to install on." echo " -d <disk> specify disk to install on."
echo " -f <target_flake> specify flake to deploy the nixos config of." echo " -n <target_config> specify the nixos config to deploy."
echo " Default: chaostheatre"
echo " Default: chaostheatre" echo " Default: chaostheatre"
echo " -u <target_user> specify user to deploy for." echo " -u <target_user> specify user to deploy for."
echo " Default: swarsel" echo " Default: swarsel"
@ -38,9 +39,9 @@ function yellow() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-f) -n)
shift shift
target_flake=$1 target_config=$1
;; ;;
-u) -u)
shift shift
@ -102,14 +103,14 @@ green "Generating hardware configuration"
sudo mount "$disk"2 /mnt sudo mount "$disk"2 /mnt
sudo mkdir -p /mnt/boot sudo mkdir -p /mnt/boot
sudo mount "$disk"1 /mnt/boot sudo mount "$disk"1 /mnt/boot
sudo nixos-generate-config --root /mnt --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/ sudo nixos-generate-config --root /mnt --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.nix git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix
# sudo rm -rf /root/.nix-defexpr/channels # sudo rm -rf /root/.nix-defexpr/channels
# sudo rm -rf /nix/var/nix/profiles/per-user/channels # sudo rm -rf /nix/var/nix/profiles/per-user/channels
sudo mkdir -p /root/.local/share/nix/ sudo mkdir -p /root/.local/share/nix/
printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null printf '{\"extra-substituters\":{\"https://nix-community.cachix.org\":true,\"https://nix-community.cachix.org https://cache.ngi0.nixos.org/\":true},\"extra-trusted-public-keys\":{\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=\":true,\"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=\":true}}' | sudo tee /root/.local/share/nix/trusted-settings.json > /dev/null
green "Installing flake $target_flake" green "Installing flake $target_config"
sudo nixos-install --flake .#"$target_flake" sudo nixos-install --flake .#"$target_config"
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly." yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."
green "Installation finished! Reboot to see changes" green "Installation finished! Reboot to see changes"

View file

@ -1,16 +1,16 @@
set -eo pipefail set -eo pipefail
target_flake="chaostheatre" target_config="chaostheatre"
target_user="swarsel" target_user="swarsel"
function help_and_exit() { function help_and_exit() {
echo echo
echo "Remotely installs NixOS on a target machine using this nix-config." echo "Builds SwarselSystem configuration."
echo echo
echo "USAGE: $0 [OPTIONS]" echo "USAGE: $0 [OPTIONS]"
echo echo
echo "ARGS:" echo "ARGS:"
echo " -f <target_flake> specify flake to deploy the nixos config of." echo " -n <target_config> specify nixos config to build."
echo " Default: chaostheatre" echo " Default: chaostheatre"
echo " -u <target_user> specify user to deploy for." echo " -u <target_user> specify user to deploy for."
echo " Default: swarsel" echo " Default: swarsel"
@ -39,9 +39,9 @@ function yellow() {
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
-f) -n)
shift shift
target_flake=$1 target_config=$1
;; ;;
-u) -u)
shift shift
@ -79,9 +79,9 @@ if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
else else
green "Valid SSH key found! Continuing with installation" green "Valid SSH key found! Continuing with installation"
fi fi
sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/ sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.nix git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_config"/hardware-configuration.nix
green "Installing flake $target_flake" green "Installing flake $target_config"
sudo nixos-rebuild --show-trace --flake .#"$target_flake" boot sudo nixos-rebuild --show-trace --flake .#"$target_config" boot
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly." yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."