From 91e1212d4ba183c6426d8d751edaecb3d5db4904 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 1 Jun 2019 20:23:25 -0300 Subject: 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. --- public/nixos/install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'public/nixos/install.sh') 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!" -- cgit v1.2.3