aboutsummaryrefslogtreecommitdiff
path: root/hosts/enode/disko.nix
diff options
context:
space:
mode:
authorIsabella Bastaja <isabella@sorre.xyz>2026-10-04 21:29:47 +0200
committerIsabella Bastaja <isabella@sorre.xyz>2026-10-06 23:25:49 +0200
commit91629938bb4f455c5c04331d4a8fa60253ffa435 (patch)
tree99d3c012d31d3fb5bfe2c27bdf430921c53ab0ba /hosts/enode/disko.nix
parentcdb8341737e398743a5e5b13d24b408fd8398974 (diff)
enode: disk setup, minor fixes
Diffstat (limited to 'hosts/enode/disko.nix')
-rw-r--r--hosts/enode/disko.nix108
1 files changed, 91 insertions, 17 deletions
diff --git a/hosts/enode/disko.nix b/hosts/enode/disko.nix
index 82e7d5f..d9dfb20 100644
--- a/hosts/enode/disko.nix
+++ b/hosts/enode/disko.nix
@@ -1,32 +1,106 @@
+let
+ espPartition = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [
+ "default"
+ ];
+ };
+ cryptroot = {
+ type = "luks";
+ name = "cryptroot";
+ content = {
+ type = "btrfs";
+ extraArgs = [
+ "-L"
+ "nixos"
+ "-f"
+ ];
+ subvolumes = {
+ "/root" = {
+ mountpoint = "/";
+ mountOptions = [
+ "subvol=root"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ "/root-blank" = {
+ mountOptions = [
+ "subvol=root-blank"
+ "nodatacow"
+ "noatime"
+ ];
+ };
+ "/home" = {
+ mountpoint = "/home";
+ mountOptions = [
+ "subvol=home"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ "/nix" = {
+ mountpoint = "/nix";
+ mountOptions = [
+ "subvol=nix"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ "/persist" = {
+ mountpoint = "/persist";
+ mountOptions = [
+ "subvol=persist"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ "/lib" = {
+ mountpoint = "/var/lib";
+ mountOptions = [
+ "subvol=lib"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ "/log" = {
+ mountpoint = "/var/log";
+ mountOptions = [
+ "subvol=log"
+ "compress=zstd"
+ "noatime"
+ ];
+ };
+ };
+ };
+ };
+in
{
disko.devices.disk.vm-disk = {
- device = "/dev/vda";
type = "disk";
+ device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
- type = "EF00";
+ label = "boot";
+ name = "ESP";
size = "1G";
- content = {
- type = "filesystem";
- format = "vfat";
- mountpoint = "/boot";
- mountOptions = [
- "umask=0077"
- "nofail"
- ];
- };
+ type = "EF00";
+ content = espPartition;
};
- root = {
+ luks = {
size = "100%";
- content = {
- type = "filesystem";
- format = "ext4";
- mountpoint = "/";
- };
+ label = "luks";
+ content = cryptroot;
};
};
};
};
+
+ fileSystems."/var/log".neededForBoot = true;
+ fileSystems."/var/lib".neededForBoot = true;
+ fileSystems."/persist".neededForBoot = true;
}