feat: add caches to local installer

This commit is contained in:
Swarsel 2024-12-19 11:01:01 +01:00
parent 7b0d2ee700
commit a0ade4d66d
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
2 changed files with 4 additions and 0 deletions

View file

@ -3054,6 +3054,8 @@ This program sets up a new NixOS host.
fi
sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.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}}' > /root/.local/share/nix/trusted-settings.json
green "Installing flake $target_flake"
sudo nixos-rebuild --show-trace --flake .#"$target_flake" boot
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."

View file

@ -70,6 +70,8 @@ if [[ $local_keys != *"${pub_arr[1]}"* ]]; then
fi
sudo nixos-generate-config --dir /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/
git add /home/"$target_user"/.dotfiles/hosts/nixos/"$target_flake"/hardware-configuration.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}}' > /root/.local/share/nix/trusted-settings.json
green "Installing flake $target_flake"
sudo nixos-rebuild --show-trace --flake .#"$target_flake" boot
yellow "Please keep in mind that this is only a demo of the configuration. Things might break unexpectedly."