aboutsummaryrefslogtreecommitdiff
path: root/public/nixos
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-01 20:23:25 -0300
committerEuAndreh <eu@euandre.org>2019-06-01 20:23:25 -0300
commit91e1212d4ba183c6426d8d751edaecb3d5db4904 (patch)
tree0d0963dc82aa10f9641e1e17f912624bf5acce26 /public/nixos
parentRemove with pkgs; usage from configuration.nix (diff)
downloaddotfiles-91e1212d4ba183c6426d8d751edaecb3d5db4904.tar.gz
dotfiles-91e1212d4ba183c6426d8d751edaecb3d5db4904.tar.xz
Duplicate Nix files from /etc/nixos/* to /mnt/etc/nixos/
The /etc/nixos/ path is temporary, and vanishes once the computer is rebooted after finishing the installation. However, the Nix files downloaded by install.sh point to /etc/nixos/, and they will be afterwards be symlinked to the files in this git repository. This prevents me from using relative paths like ./hardware-configuration.nix or similar. The duplicate files are there to support building the OS during the installation phase (the nixos-install command) without needing to make it generic for everyday usage.
Diffstat (limited to 'public/nixos')
-rwxr-xr-xpublic/nixos/install.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/public/nixos/install.sh b/public/nixos/install.sh
index 211f0f7..f2b1abe 100755
--- a/public/nixos/install.sh
+++ b/public/nixos/install.sh
@@ -116,8 +116,11 @@ green "Done."
yellow "Generating '/mnt/etc/nixos/*' Nix files'..."
nixos-generate-config --root /mnt
-mv "${TMP_DIR}/configuration.nix" /mnt/etc/nixos/configuration.nix
-mv "${TMP_DIR}/local-configuration.nix" /mnt/etc/nixos/local-configuration.nix
+cp /mnt/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
+cp "${TMP_DIR}/configuration.nix" /mnt/etc/nixos/configuration.nix
+cp "${TMP_DIR}/configuration.nix" /etc/nixos/configuration.nix
+cp "${TMP_DIR}/local-configuration.nix" /mnt/etc/nixos/local-configuration.nix
+cp "${TMP_DIR}/local-configuration.nix" /etc/nixos/local-configuration.nix
green "Done."
yellow "Generating password-hash.txt file for user login..."
@@ -130,6 +133,7 @@ while true; do
red "Please try again"
done
mkpasswd -m sha-512 "$password" > /mnt/etc/nixos/password-hash.txt
+cp /mnt/etc/nixos/password-hash.txt /etc/nixos/password-hash.txt
green "Done."
yellow "Installing NixOS!"