summaryrefslogtreecommitdiffstats
path: root/lass/5pkgs/install-system
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-02-02 17:03:15 +0100
committertv <tv@krebsco.de>2023-02-02 17:03:15 +0100
commit3c1a1f0f09e1789ebda529e597c1bb8b7bc7d0c4 (patch)
treee041536cd96726fb87adc15fbe95f1eabd280ba9 /lass/5pkgs/install-system
parentfc00990f712663688e5aea85624cb9317e9f4128 (diff)
parent46ae6fc00c3e1aee5bc5db846ec91e30c430f0f1 (diff)
Merge remote-tracking branch 'prism/master' into head
Diffstat (limited to 'lass/5pkgs/install-system')
-rw-r--r--lass/5pkgs/install-system/default.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/lass/5pkgs/install-system/default.nix b/lass/5pkgs/install-system/default.nix
index 9a392e669..0e13265f6 100644
--- a/lass/5pkgs/install-system/default.nix
+++ b/lass/5pkgs/install-system/default.nix
@@ -5,13 +5,21 @@ pkgs.writers.writeDashBin "install-system" ''
TARGET=$2
# format
if ! (sshn "$TARGET" -- mountpoint /mnt); then
- nix run github:numtide/nixos-remote -- --stop-after-disko --store-paths "$(nix-build --no-out-link -I stockholm="$HOME"/sync/stockholm -I nixos-config="$HOME"/sync/stockholm/lass/1systems/"$SYSTEM"/physical.nix '<nixpkgs/nixos>' -A config.system.build.diskoNoDeps)" /dev/null "$TARGET"
+ if ! (sshn "$TARGET" -- type -p nix); then
+ nix run github:numtide/nixos-remote -- --stop-after-disko --store-paths "$(nix-build --no-out-link -I stockholm="$HOME"/sync/stockholm -I nixos-config="$HOME"/sync/stockholm/lass/1systems/"$SYSTEM"/physical.nix '<nixpkgs/nixos>' -A config.system.build.diskoNoDeps)" /dev/null "$TARGET"
+ else
+ disko=$(nix-build -I stockholm=$HOME/sync/stockholm -I secrets=$HOME/sync/stockholm/lass/2configs/tests/dummy-secrets -I nixos-config=$HOME/sync/stockholm/lass/1systems/$SYSTEM/physical.nix '<nixpkgs/nixos>' -A config.system.build.disko)
+ NIX_SSHOPTS='-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' nix-copy-closure --to "$TARGET" "$disko"
+ sshn -t "$TARGET" -- "$disko"
+ fi
fi
# install dependencies
sshn "$TARGET" << SSH
- nix-channel --update
- nix-env -iA nixos.git
+ if ! type -p git; then
+ nix-channel --update
+ nix-env -iA nixos.git
+ fi
SSH
# populate
@@ -19,8 +27,9 @@ pkgs.writers.writeDashBin "install-system" ''
# install
sshn "$TARGET" << SSH
- ln -s /mnt/var/src /var/src
- NIXOS_CONFIG=/var/src/nixos-config nixos-install --no-root-password -I /var/src
+ NIXOS_CONFIG=/var/src/nixos-config nixos-install --no-root-password -I /mnt/var/src
+ nixos-enter -- nixos-rebuild -I /var/src switch --install-bootloader
+ umount -R /mnt
zpool export -fa
SSH
''