diff --git a/curacao_usb/disko-hanging.nix b/curacao_usb/disko-hanging.nix deleted file mode 100644 index addc8ca..0000000 --- a/curacao_usb/disko-hanging.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "crypted"; - settings.allowDiscards = true; - passwordFile = "/tmp/secret.key"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/curacao_usb/disko-working.nix b/curacao_usb/disko-working.nix deleted file mode 100644 index dceed99..0000000 --- a/curacao_usb/disko-working.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - disko.devices = { - disk = { - vdb = { - type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "500M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/curacao_usb/disko.nix b/curacao_usb/disko.nix deleted file mode 120000 index 5ce14d9..0000000 --- a/curacao_usb/disko.nix +++ /dev/null @@ -1 +0,0 @@ -disko-hanging.nix \ No newline at end of file diff --git a/curacao_usb/disko.nix b/curacao_usb/disko.nix new file mode 100644 index 0000000..962cba1 --- /dev/null +++ b/curacao_usb/disko.nix @@ -0,0 +1 @@ +import ../dk/single_uefi_btrfs.nix { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; } diff --git a/curacao_usb/disko-desired.nix b/dk/single_uefi_btrfs.nix similarity index 88% rename from curacao_usb/disko-desired.nix rename to dk/single_uefi_btrfs.nix index fa2a024..b839c1f 100644 --- a/curacao_usb/disko-desired.nix +++ b/dk/single_uefi_btrfs.nix @@ -1,9 +1,10 @@ +{ id, name, ... }: { disko.devices = { disk = { - pindakaas_sd = { + "${name}" = { type = "disk"; - device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; + device = "/dev/disk/by-id/${id}"; content = { type = "gpt"; partitions = { @@ -24,8 +25,8 @@ size = "100%"; content = { type = "luks"; - name = "pindakaas_sd"; - #passwordFile = "/tmp/secret.key"; # Commented out so asked interactively + name = "${name}"; + passwordFile = "/tmp/secret.key"; # TODO Generate this somehow settings = { # Not having SSDs die fast is more important than crypto # nerds that could potentially discover which filesystem I @@ -61,4 +62,5 @@ }; }; }; - } + }; +} diff --git a/pindakaas_sd/disko.nix b/pindakaas_sd/disko.nix index 58afe2e..f3b4eae 100644 --- a/pindakaas_sd/disko.nix +++ b/pindakaas_sd/disko.nix @@ -1,65 +1 @@ -{ - disko.devices = { - disk = { - pindakaas_sd = { - type = "disk"; - device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99"; - content = { - type = "gpt"; - partitions = { - ESP = { - # Needs enough to store multiple kernel generations - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "pindakaas_sd"; - passwordFile = "/tmp/secret.key"; # TODO Generate this somehow - settings = { - # Not having SSDs die fast is more important than crypto - # nerds that could potentially discover which filesystem I - # use from TRIM patterns - allowDiscards = true; - }; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/nixos" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/home" = { - mountpoint = "/home"; - mountOptions = [ "compress=zstd" "relatime" ]; - }; - "/nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - # Maybe later - # "/swap" = { - # mountpoint = "/.swapvol"; - # swap.swapfile.size = "20M"; - # }; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} +import ../dk/single_uefi_btrfs.nix { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; }