Skip to content

Commit

Permalink
feat(nuc): Update disko setup
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Oct 25, 2023
1 parent b0fdc83 commit d83ced8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 51 deletions.
1 change: 1 addition & 0 deletions hosts/nuc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
imports = [
../home.nix
./hardware-configuration.nix
./disko.nix
];

## Modules
Expand Down
66 changes: 15 additions & 51 deletions hosts/nuc/disko.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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;
};
};
};
Expand Down

0 comments on commit d83ced8

Please sign in to comment.