From d83ced8b5ad9f3424e2ee0c31bebc98f8a28aa44 Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Wed, 25 Oct 2023 13:39:44 -0500 Subject: [PATCH] feat(nuc): Update disko setup --- hosts/nuc/default.nix | 1 + hosts/nuc/disko.nix | 66 ++++++++++--------------------------------- 2 files changed, 16 insertions(+), 51 deletions(-) diff --git a/hosts/nuc/default.nix b/hosts/nuc/default.nix index f2f3334e..c285466d 100644 --- a/hosts/nuc/default.nix +++ b/hosts/nuc/default.nix @@ -3,6 +3,7 @@ imports = [ ../home.nix ./hardware-configuration.nix + ./disko.nix ]; ## Modules diff --git a/hosts/nuc/disko.nix b/hosts/nuc/disko.nix index 3624e959..6ca03788 100644 --- a/hosts/nuc/disko.nix +++ b/hosts/nuc/disko.nix @@ -1,9 +1,10 @@ -{ +{inputs}: { + imports = [inputs.disko.nixosModules.disko]; disko.devices = { disk = { x = { type = "disk"; - device = "/dev/sdx"; + device = "/dev/sda"; content = { type = "gpt"; partitions = { @@ -26,74 +27,37 @@ }; }; }; - y = { - type = "disk"; - device = "/dev/sdy"; - content = { - type = "gpt"; - partitions = { - zfs = { - size = "100%"; - content = { - type = "zfs"; - pool = "zroot"; - }; - }; - }; - }; - }; }; zpool = { zroot = { type = "zpool"; - mode = "mirror"; rootFsOptions = { compression = "zstd"; "com.sun:auto-snapshot" = "false"; }; - mountpoint = "/"; postCreateHook = "zfs snapshot zroot@blank"; - datasets = { - zfs_fs = { + "system" = { type = "zfs_fs"; - mountpoint = "/zfs_fs"; - options."com.sun:auto-snapshot" = "true"; + mountpoint = "none"; }; - zfs_unmounted_fs = { + "system/root" = { type = "zfs_fs"; - options.mountpoint = "none"; + mountpoint = "/"; }; - zfs_legacy_fs = { + "system/var" = { type = "zfs_fs"; - options.mountpoint = "legacy"; - mountpoint = "/zfs_legacy_fs"; + mountpoint = "/var"; }; - zfs_testvolume = { - type = "zfs_volume"; - size = "10M"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/ext4onzfs"; - }; - }; - encrypted = { + "local/nix" = { type = "zfs_fs"; - options = { - mountpoint = "none"; - encryption = "aes-256-gcm"; - keyformat = "passphrase"; - keylocation = "file:///tmp/secret.key"; - }; - # use this to read the key during boot - # postCreateHook = '' - # zfs set keylocation="prompt" "zroot/$name"; - # ''; + mountpoint = "/nix"; }; - "encrypted/test" = { + + "user/home/emiller" = { type = "zfs_fs"; - mountpoint = "/zfs_crypted"; + mountpoint = "/home/emiller"; + # TODO neededForBoot = true; }; }; };