From add9f3161321417da7493ff2c22c643c44e28c47 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 8 Jul 2023 15:14:05 +0200 Subject: l hilum.r: add usb-flash stick, update disko config --- lass/1systems/hilum/disk.nix | 18 ++++-------------- lass/1systems/hilum/flash-stick.sh | 8 +++++++- lass/1systems/hilum/physical.nix | 5 ++++- 3 files changed, 15 insertions(+), 16 deletions(-) (limited to 'lass') diff --git a/lass/1systems/hilum/disk.nix b/lass/1systems/hilum/disk.nix index 926401648..b5199d432 100644 --- a/lass/1systems/hilum/disk.nix +++ b/lass/1systems/hilum/disk.nix @@ -10,18 +10,14 @@ partitions = [ { name = "boot"; - type = "partition"; start = "0"; end = "1M"; - part-type = "primary"; flags = ["bios_grub"]; } { - type = "partition"; name = "ESP"; - start = "1MiB"; + start = "1M"; end = "50%"; - fs-type = "fat32"; bootable = true; content = { type = "filesystem"; @@ -31,18 +27,12 @@ } { name = "root"; - type = "partition"; start = "50%"; end = "100%"; content = { - type = "luks"; - name = "hilum_luks"; - keyFile = keyFile; - content = { - type = "filesystem"; - format = "xfs"; - mountpoint = "/"; - }; + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; } ]; diff --git a/lass/1systems/hilum/flash-stick.sh b/lass/1systems/hilum/flash-stick.sh index 17a5fc580..9846ea087 100755 --- a/lass/1systems/hilum/flash-stick.sh +++ b/lass/1systems/hilum/flash-stick.sh @@ -3,9 +3,13 @@ set -efux disk=$1 +cd "$(dirname "$0")" export NIXPKGS_ALLOW_UNFREE=1 (umask 077; pass show admin/hilum/luks > /tmp/hilum.luks) trap 'rm -f /tmp/hilum.luks' EXIT +echo "$disk" > /tmp/hilum-disk +trap 'rm -f /tmp/hilum-disk' EXIT + stockholm_root=$(git rev-parse --show-toplevel) ssh root@localhost -t -- $(nix-build \ --no-out-link \ @@ -31,7 +35,9 @@ $(nix-build \ --arg force true ) ssh root@localhost << SSH -NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-root-password --root /mnt/hilum -I /var/src +set -efux +mkdir -p /mnt/hilum/etc +NIXOS_CONFIG=/mnt/hilum/var/src/nixos-config nixos-install --no-bootloader --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 diff --git a/lass/1systems/hilum/physical.nix b/lass/1systems/hilum/physical.nix index 6f160062d..9caf8e531 100644 --- a/lass/1systems/hilum/physical.nix +++ b/lass/1systems/hilum/physical.nix @@ -15,7 +15,7 @@ ; in lib.mkOption { type = lib.types.str; - default = tryFile "/etc/hilum-disk" "/dev/sdz"; + default = tryFile "/etc/hilum-disk" (tryFile "/tmp/hilum-disk" "/dev/sdz"); }; config.environment.etc.hilum-disk.text = config.mainDisk; } @@ -47,4 +47,7 @@ nix.maxJobs = lib.mkDefault 4; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + #weird bug with nixos-enter + services.logrotate.enable = false; } -- cgit v1.2.3