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

View file

@ -55,7 +55,7 @@
};
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
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"

View file

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

View file

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