diff --git a/nixos/disk-config.nix.b b/nixos/disk-config.nix.b new file mode 100644 index 0000000..77b56ab --- /dev/null +++ b/nixos/disk-config.nix.b @@ -0,0 +1,56 @@ +{ + disko.devices = { + disk = { + vdb = { + type = "disk"; + device = "/dev/nvme0n1"; + 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/elliott" = { }; + # Parent is not mounted so the mountpoint must be set + "/nix" = { + mountOptions = [ "compress=zstd" "noatime" ]; + mountpoint = "/nix"; + }; + }; + + mountpoint = "/partition-root"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/server-steps.md b/server-steps.md index e7311c1..f948334 100644 --- a/server-steps.md +++ b/server-steps.md @@ -1,6 +1,6 @@ # Server Steps -1. Set up declarative disk partitioning +1. Set up declarative disk partitioning (ephemeral) 2. Implement SOPS for secret management 3. Lock down machine IP addresses, passed in through flake as param 4. Create a k8s cluster on server