zfs disko config

This commit is contained in:
Joseph Hanson 2024-06-24 14:15:52 -05:00
parent 84d0a763e0
commit 5c5c4afb14
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
4 changed files with 67 additions and 23 deletions

View file

@ -17,6 +17,24 @@
"type": "github" "type": "github"
} }
}, },
"disko": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1719236180,
"narHash": "sha256-VZAfBk2Lo8hQy/NQ4XVSpTICT0ownXBUi1QvGfdlxaM=",
"owner": "nix-community",
"repo": "disko",
"rev": "dd4d1663ccf7fbdb32361b9afe9e71206584cd4c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"dream2nix": { "dream2nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -177,7 +195,7 @@
"nix-inspect": { "nix-inspect": {
"inputs": { "inputs": {
"nci": "nci", "nci": "nci",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"parts": "parts_2" "parts": "parts_2"
}, },
"locked": { "locked": {
@ -234,16 +252,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709961763, "lastModified": 1719082008,
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", "rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -265,6 +283,22 @@
} }
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": {
"lastModified": 1709961763,
"narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1719075281, "lastModified": 1719075281,
"narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=",
@ -381,13 +415,14 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-inspect": "nix-inspect", "nix-inspect": "nix-inspect",
"nix-vscode-extensions": "nix-vscode-extensions", "nix-vscode-extensions": "nix-vscode-extensions",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_3",
"nur": "nur", "nur": "nur",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"
} }

View file

@ -55,7 +55,7 @@
}; };
outputs = outputs =
{ self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, ... } @ inputs: { self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, disko, ... } @ inputs:
let let
forAllSystems = nixpkgs.lib.genAttrs [ forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux" "aarch64-linux"

View file

@ -18,22 +18,22 @@
}; };
fileSystems."/" = fileSystems."/" =
{ device = "zpool/root"; { device = "zroot/root";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/nix" = fileSystems."/nix" =
{ device = "zpool/nix"; { device = "zroot/nix";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var" = fileSystems."/var" =
{ device = "zpool/var"; { device = "zroot/var";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/home" = fileSystems."/home" =
{ device = "zpool/home"; { device = "zroot/home";
fsType = "zfs"; fsType = "zfs";
}; };

View file

@ -26,6 +26,7 @@
}; };
}; };
}; };
};
zpool = { zpool = {
zroot = { zroot = {
type = "zpool"; type = "zpool";
@ -37,36 +38,44 @@
acltype = "posixacl"; acltype = "posixacl";
}; };
options = {
ashift = 12;
};
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank";
datasets = { datasets = {
root = { root = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/"; mountpoint = "/";
options.zfsutil = ""; options = {
ashift = 12;
zfsutil = "";
};
}; };
nix = { nix = {
type = "zfs_fs"; type = "zfs_fs";
options.mountpoint = "/nix"; mountpoint = "/nix";
options.zfsutil = ""; options = {
ashift = 12;
zfsutil = "";
};
}; };
var = { var = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/var"; mountpoint = "/var";
options.zfsutil = ""; options = {
ashift = 12;
zfsutil = "";
};
}; };
home = { home = {
type = "zfs_fs"; type = "zfs_fs";
mountpoint = "/home"; mountpoint = "/home";
options."com.sun:auto-snapshot" = "true"; options = {
options.zfsutil = ""; ashift = 12;
"com.sun:auto-snapshot" = "true";
zfsutil = "";
};
}; };
}; };
}; };