From 3da0a1cb522610abf06c450860f68143bf59e3a1 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Wed, 18 Sep 2024 12:47:54 -0500 Subject: [PATCH] update telchar disk settings to btrfs --- flake.nix | 2 +- nixos/hosts/telchar/default.nix | 29 ----------------- nixos/profiles/disko-telchar.nix | 56 ++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 30 deletions(-) create mode 100644 nixos/profiles/disko-telchar.nix diff --git a/flake.nix b/flake.nix index 8bb8d6f..75e74a1 100644 --- a/flake.nix +++ b/flake.nix @@ -177,7 +177,7 @@ inputs.nixos-hardware.nixosModules.framework-16-7040-amd ./nixos/profiles/hw-framework-16-7840hs.nix disko.nixosModules.disko - (import ./nixos/profiles/disko-nixos.nix { disks = [ "/dev/nvme0n1" ]; }) + (import ./nixos/profiles/disko-telchar.nix { disks = [ "/dev/nvme0n1" ]; }) lix-module.nixosModules.default ]; profileModules = [ diff --git a/nixos/hosts/telchar/default.nix b/nixos/hosts/telchar/default.nix index ed08cf4..3184ff6 100644 --- a/nixos/hosts/telchar/default.nix +++ b/nixos/hosts/telchar/default.nix @@ -18,28 +18,6 @@ extraModulePackages = [ ]; }; - fileSystems = { - "/" = { - device = "zroot/root"; - fsType = "zfs"; - }; - - "/nix" = { - device = "zroot/nix"; - fsType = "zfs"; - }; - - "/var" = { - device = "zroot/var"; - fsType = "zfs"; - }; - - "/home" = { - device = "zroot/home"; - fsType = "zfs"; - }; - }; - swapDevices = [ ]; virtualisation.docker.enable = true; @@ -57,13 +35,6 @@ borg.pika-backup.enable = true; }; - # Services config - services = { - vault = { - enable = false; - }; - }; - framework_wifi_swap.enable = true; security._1password.enable = true; }; diff --git a/nixos/profiles/disko-telchar.nix b/nixos/profiles/disko-telchar.nix new file mode 100644 index 0000000..fe735ac --- /dev/null +++ b/nixos/profiles/disko-telchar.nix @@ -0,0 +1,56 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-diskseq/1"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "128M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + # Subvolume name is different from mountpoint + "/rootfs" = { + mountpoint = "/"; + }; + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + # Sub(sub)volume doesn't need a mountpoint as its parent is mounted + "/home/user" = { }; + # Parent is not mounted so the mountpoint must be set + "/nix" = { + mountOptions = [ "compress=zstd" "noatime" ]; + mountpoint = "/nix"; + }; + }; + + mountpoint = "/partition-root"; + }; + }; + }; + }; + }; + }; + }; +}