alright disko

This commit is contained in:
Gerg-L 2023-08-21 23:05:13 -04:00
parent 1d77028ac5
commit 9ce12a87d3
2 changed files with 40 additions and 28 deletions

View file

@ -1,14 +1,15 @@
{disko, ...}: { {disko, ...}: {
imports = [disko.nixosModules.disko]; imports = [disko.nixosModules.disko];
disko.devices = { disko.devices.disk.nvme0n1 = let
disk.nvme0n1 = { baseDevice = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456";
device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; in {
device = baseDevice;
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
ESP = { ESP = {
name = "ESP"; device = "${baseDevice}-part1";
start = "1MiB"; start = "1MiB";
end = "1GiB"; end = "1GiB";
content = { content = {
@ -18,8 +19,10 @@
}; };
}; };
root = { root = {
device = "${baseDevice}-part2";
start = "1GiB"; start = "1GiB";
end = "100%"; end = "100%";
type = "EF00";
content = { content = {
type = "filesystem"; type = "filesystem";
format = "ext4"; format = "ext4";
@ -29,6 +32,5 @@
}; };
}; };
}; };
};
_file = ./disko.nix; _file = ./disko.nix;
} }

View file

@ -2,13 +2,16 @@
imports = [disko.nixosModules.disko]; imports = [disko.nixosModules.disko];
disko.devices = { disko.devices = {
disk = { disk = {
"0E" = { "0E" = let
baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E";
in {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; device = baseDevice;
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
BOOT = { BOOT = {
device = "${baseDevice}-part1";
type = "EF00"; type = "EF00";
start = "0"; start = "0";
end = "4G"; end = "4G";
@ -19,6 +22,7 @@
}; };
}; };
swap = { swap = {
device = "${baseDevice}-part2";
start = "5G"; start = "5G";
end = "21G"; end = "21G";
content = { content = {
@ -27,6 +31,7 @@
}; };
}; };
zfsroot = { zfsroot = {
device = "${baseDevice}-part3";
start = "21G"; start = "21G";
end = "100%"; end = "100%";
content = { content = {
@ -37,13 +42,16 @@
}; };
}; };
}; };
"22" = { "22" = let
baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22";
in {
type = "disk"; type = "disk";
device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"; device = baseDevice;
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions = {
BOOT = { BOOT = {
device = "${baseDevice}-part1";
type = "EF00"; type = "EF00";
start = "0"; start = "0";
end = "4G"; end = "4G";
@ -54,6 +62,7 @@
}; };
}; };
swap = { swap = {
device = "${baseDevice}-part2";
start = "5G"; start = "5G";
end = "21G"; end = "21G";
content = { content = {
@ -62,6 +71,7 @@
}; };
}; };
zfsroot = { zfsroot = {
device = "${baseDevice}-part3";
start = "21G"; start = "21G";
end = "100%"; end = "100%";
content = { content = {