diff --git a/flake.nix b/flake.nix index 99f34f6..eb6fd48 100644 --- a/flake.nix +++ b/flake.nix @@ -264,9 +264,13 @@ name = "build"; text = '' set -euo pipefail - [[ "$#" -eq 1 ]] \ - || { echo "usage: build " >&2; exit 1; } - nom build --no-link --print-out-paths --show-trace .#nodes."$1".config.system.build.toplevel + [[ "$#" -ge 1 ]] \ + || { echo "usage: build ..." >&2; exit 1; } + HOSTS=() + for h in "$@"; do + HOSTS+=(".#nodes.$h.config.system.build.toplevel") + done + nom build --no-link --print-out-paths --show-trace "''${HOSTS[@]}" ''; }; help = "Build a host configuration"; diff --git a/hosts/kroma/fs.nix b/hosts/kroma/fs.nix index 32973fe..08d8221 100644 --- a/hosts/kroma/fs.nix +++ b/hosts/kroma/fs.nix @@ -13,9 +13,24 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - efi = partEfi "0%" "1GiB"; - swap = partSwap "1GiB" "17GiB"; - "rpool_${disks.m2-ssd}" = partLuksZfs disks.m2-ssd "rpool" "17GiB" "100%"; + efi = + partEfi "0%" "1GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part1"; + }; + swap = + partSwap "1GiB" "17GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part2"; + }; + "rpool_${disks.m2-ssd}" = + partLuksZfs disks.m2-ssd "rpool" "17GiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part3"; + }; }; }; }; diff --git a/hosts/nom/fs.nix b/hosts/nom/fs.nix index de21550..e729121 100644 --- a/hosts/nom/fs.nix +++ b/hosts/nom/fs.nix @@ -13,7 +13,12 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - "rpool_${disks.m2-ssd}" = partLuksZfs disks.m2-ssd "rpool" "0%" "100%"; + "rpool_${disks.m2-ssd}" = + partLuksZfs disks.m2-ssd "rpool" "0%" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part1"; + }; }; }; }; @@ -23,8 +28,18 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - efi = partEfi "0%" "8GiB"; - swap = partSwap "8GiB" "100%"; + efi = + partEfi "0%" "8GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.boot-ssd}-part1"; + }; + swap = + partSwap "8GiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.boot-ssd}-part2"; + }; }; }; }; diff --git a/hosts/sentinel/fs.nix b/hosts/sentinel/fs.nix index 8f09b32..f9fb4ac 100644 --- a/hosts/sentinel/fs.nix +++ b/hosts/sentinel/fs.nix @@ -13,9 +13,24 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - grub = partGrub "0%" "1MiB"; - bios = partEfi "1MiB" "512MiB"; - "rpool_${disks.main}" = partLuksZfs disks.main "rpool" "512MiB" "100%"; + grub = + partGrub "0%" "1MiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.main}-part1"; + }; + bios = + partEfi "1MiB" "512MiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.main}-part2"; + }; + "rpool_${disks.main}" = + partLuksZfs disks.main "rpool" "512MiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.main}-part3"; + }; }; }; }; diff --git a/hosts/sire/fs.nix b/hosts/sire/fs.nix index 16c1e4d..e45ca72 100644 --- a/hosts/sire/fs.nix +++ b/hosts/sire/fs.nix @@ -14,8 +14,18 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - efi = partEfi "0%" "1GiB"; - "rpool_${disks.m2-ssd-1}" = partLuksZfs disks.m2-ssd-1 "rpool" "1GiB" "100%"; + efi = + partEfi "0%" "1GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd-1}-part1"; + }; + "rpool_${disks.m2-ssd-1}" = + partLuksZfs disks.m2-ssd-1 "rpool" "1GiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd-1}-part2"; + }; }; }; }; diff --git a/hosts/ward/fs.nix b/hosts/ward/fs.nix index 6909954..3757162 100644 --- a/hosts/ward/fs.nix +++ b/hosts/ward/fs.nix @@ -13,9 +13,24 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - efi = partEfi "0%" "1GiB"; - swap = partSwap "1GiB" "17GiB"; - "rpool_${disks.m2-ssd}" = partLuksZfs disks.m2-ssd "rpool" "17GiB" "100%"; + efi = + partEfi "0%" "1GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part1"; + }; + swap = + partSwap "1GiB" "17GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part2"; + }; + "rpool_${disks.m2-ssd}" = + partLuksZfs disks.m2-ssd "rpool" "17GiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.m2-ssd}-part3"; + }; }; }; }; diff --git a/hosts/zackbiene/fs.nix b/hosts/zackbiene/fs.nix index 69ac4c4..2f4531b 100644 --- a/hosts/zackbiene/fs.nix +++ b/hosts/zackbiene/fs.nix @@ -13,9 +13,24 @@ in { content = with lib.disko.gpt; { type = "gpt"; partitions = { - efi = partEfi "0%" "1GiB"; - swap = partSwap "1GiB" "9GiB"; - "rpool_${disks.mmc}" = partLuksZfs disks.mmc "rpool" "9GiB" "100%"; + efi = + partEfi "0%" "1GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.mmc}-part1"; + }; + swap = + partSwap "1GiB" "9GiB" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.mmc}-part2"; + }; + "rpool_${disks.mmc}" = + partLuksZfs disks.mmc "rpool" "9GiB" "100%" + // { + # FIXME: Needed because partlabels are 💩: https://github.com/nix-community/disko/issues/551 + device = "/dev/disk/by-id/${disks.mmc}-part3"; + }; }; }; }; diff --git a/modules/config/boot.nix b/modules/config/boot.nix index dfbace0..28def1a 100644 --- a/modules/config/boot.nix +++ b/modules/config/boot.nix @@ -12,6 +12,7 @@ # TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"]; extraBin.ip = "${pkgs.iproute2}/bin/ip"; extraBin.ping = "${pkgs.iputils}/bin/ping"; + extraBin.cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup"; # Give me a usable shell please users.root.shell = "${pkgs.bashInteractive}/bin/bash"; storePaths = ["${pkgs.bashInteractive}/bin/bash"];