mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
fix: add device overrides for new disko partlabel stuff
This commit is contained in:
parent
5aad6c3a84
commit
aab790065a
8 changed files with 110 additions and 20 deletions
10
flake.nix
10
flake.nix
|
@ -264,9 +264,13 @@
|
||||||
name = "build";
|
name = "build";
|
||||||
text = ''
|
text = ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
[[ "$#" -eq 1 ]] \
|
[[ "$#" -ge 1 ]] \
|
||||||
|| { echo "usage: build <host>" >&2; exit 1; }
|
|| { echo "usage: build <HOST>..." >&2; exit 1; }
|
||||||
nom build --no-link --print-out-paths --show-trace .#nodes."$1".config.system.build.toplevel
|
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";
|
help = "Build a host configuration";
|
||||||
|
|
|
@ -13,9 +13,24 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
efi = partEfi "0%" "1GiB";
|
efi =
|
||||||
swap = partSwap "1GiB" "17GiB";
|
partEfi "0%" "1GiB"
|
||||||
"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}-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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,12 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
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; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
efi = partEfi "0%" "8GiB";
|
efi =
|
||||||
swap = partSwap "8GiB" "100%";
|
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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,9 +13,24 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
grub = partGrub "0%" "1MiB";
|
grub =
|
||||||
bios = partEfi "1MiB" "512MiB";
|
partGrub "0%" "1MiB"
|
||||||
"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}-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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,8 +14,18 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
efi = partEfi "0%" "1GiB";
|
efi =
|
||||||
"rpool_${disks.m2-ssd-1}" = partLuksZfs disks.m2-ssd-1 "rpool" "1GiB" "100%";
|
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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,9 +13,24 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
efi = partEfi "0%" "1GiB";
|
efi =
|
||||||
swap = partSwap "1GiB" "17GiB";
|
partEfi "0%" "1GiB"
|
||||||
"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}-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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,9 +13,24 @@ in {
|
||||||
content = with lib.disko.gpt; {
|
content = with lib.disko.gpt; {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
efi = partEfi "0%" "1GiB";
|
efi =
|
||||||
swap = partSwap "1GiB" "9GiB";
|
partEfi "0%" "1GiB"
|
||||||
"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}-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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
# TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"];
|
# TODO good idea? targets.emergency.wants = ["network.target" "sshd.service"];
|
||||||
extraBin.ip = "${pkgs.iproute2}/bin/ip";
|
extraBin.ip = "${pkgs.iproute2}/bin/ip";
|
||||||
extraBin.ping = "${pkgs.iputils}/bin/ping";
|
extraBin.ping = "${pkgs.iputils}/bin/ping";
|
||||||
|
extraBin.cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
|
||||||
# Give me a usable shell please
|
# Give me a usable shell please
|
||||||
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
|
users.root.shell = "${pkgs.bashInteractive}/bin/bash";
|
||||||
storePaths = ["${pkgs.bashInteractive}/bin/bash"];
|
storePaths = ["${pkgs.bashInteractive}/bin/bash"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue