summaryrefslogtreecommitdiffstats
path: root/lass/1systems/hilum/flash-stick.sh
diff options
context:
space:
mode:
authorlassulus <git@lassul.us>2023-01-26 16:14:47 +0100
committerlassulus <git@lassul.us>2023-01-26 16:14:47 +0100
commit2b01c332826d2d59b7fdbf4a7924e827338920f9 (patch)
tree53ff83a08dabd050887a0e14f93d9c7ef4a02bbc /lass/1systems/hilum/flash-stick.sh
parent18efc15b2a2694dac07f89d33bb1243492358a88 (diff)
l hilum.r: create with disko, add script
Diffstat (limited to 'lass/1systems/hilum/flash-stick.sh')
-rw-r--r--lass/1systems/hilum/flash-stick.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/lass/1systems/hilum/flash-stick.sh b/lass/1systems/hilum/flash-stick.sh
new file mode 100644
index 000000000..7b787f92a
--- /dev/null
+++ b/lass/1systems/hilum/flash-stick.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -efux
+
+disk=$1
+
+export NIXPKGS_ALLOW_UNFREE=1
+stockholm_root=$(git rev-parse --show-toplevel)
+ssh root@localhost -t -- $(nix-build \
+ --no-out-link \
+ -I nixpkgs=/var/src/nixpkgs \
+ -I stockholm="$stockholm_root" \
+ -I secrets="$stockholm_root"/lass/2configs/tests/dummy-secrets \
+ -E "with import <nixpkgs> {}; (pkgs.nixos [ { mainDisk = \"$disk\"; disko.rootMountPoint = \"/mnt/hilum\"; } ./physical.nix ]).mountScript"
+)
+$(nix-build \
+ --no-out-link \
+ -I nixpkgs=/var/src/nixpkgs \
+ "$stockholm_root"/lass/krops.nix -A populate \
+ --argstr name hilum \
+ --argstr target "root@localhost/mnt/hilum/var/src" \
+ --arg force true
+)
+ssh root@localhost << SSH
+nixos-install --no-root-password --root /mnt/hilum -I /var/src
+nixos-enter --root /mnt/hilum -- nixos-rebuild -I /var/src switch --install-bootloader
+umount -Rv /mnt/hilum
+SSH