hosts/hyacinth: init
This commit is contained in:
parent
1d770f1678
commit
f8952fc47e
8 changed files with 130 additions and 6 deletions
35
hosts/hyacinth/filesystem.nix
Normal file
35
hosts/hyacinth/filesystem.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
mkLabelMount = label: type: {
|
||||
device = "/dev/disk/by-label/${label}";
|
||||
fsType = type;
|
||||
options = [ "defaults" "relatime" ];
|
||||
};
|
||||
mkBtrfsMount = subvol: atime: mkLabelMount "CAKE" "btrfs" // {
|
||||
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvol=${subvol}" (if atime then "relatime" else "noatime") ];
|
||||
};
|
||||
in
|
||||
{
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "rootfs";
|
||||
fsType = "tmpfs";
|
||||
options = [ "defaults" "size=8G" "mode=755" ];
|
||||
};
|
||||
"/boot" = mkLabelMount "CUP" "vfat";
|
||||
|
||||
"/mnt/butter" = mkBtrfsMount "/" true;
|
||||
"/nix" = mkBtrfsMount "/current/snow" false;
|
||||
"/home" = mkBtrfsMount "/current/home" true;
|
||||
"/home/.snapshots" = mkBtrfsMount "/snapshot/home" false;
|
||||
"/root" = mkBtrfsMount "/current/root" false;
|
||||
"/var" = mkBtrfsMount "/current/var" false;
|
||||
"/persist" = {
|
||||
depends = [ "/var" ];
|
||||
device = "/var/persist";
|
||||
fsType = "none";
|
||||
options = [ "bind" ];
|
||||
neededForBoot = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue