flakes/hosts/blossom/filesystem.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

{ config, ... }:
let
mkMount = uuid: type: {
device = "/dev/disk/by-uuid/${uuid}";
fsType = type;
options = [ "defaults" "relatime" ];
};
2021-11-02 00:53:56 +07:00
mkBtrfsMount = subvolid: atime: mkMount "cf0f4302-f006-46a5-afc7-ada04d17f6f2" "btrfs" // {
options = [ "autodefrag" "compress=zstd:3" "defaults" "discard=async" "space_cache=v2" "ssd" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime") ];
};
in
{
fileSystems = {
"/" = {
device = "rootfs";
fsType = "tmpfs";
options = [ "defaults" "size=4G" "mode=755" ];
};
2021-11-02 00:53:56 +07:00
"/boot" = mkMount "186A-A42E" "vfat";
"/mnt/butter" = mkBtrfsMount 5 true;
2021-11-02 00:53:56 +07:00
"/nix" = mkBtrfsMount 257 false;
"/home" = mkBtrfsMount 259 true;
"/home/.snapshots" = mkBtrfsMount 262 false;
"/root" = mkBtrfsMount 260 false;
"/var" = mkBtrfsMount 258 false;
2022-10-05 13:32:41 +07:00
"/persist" = {
depends = [ "/var" ];
device = "/var/persist";
fsType = "none";
options = [ "bind" ];
neededForBoot = true;
};
2021-07-28 16:01:48 +07:00
2021-08-20 23:18:52 +07:00
# "/mnt/nfs" = {
# device = "192.168.100.11:/srv/nfs";
# fsType = "nfs";
# options = [ "defaults" ];
# };
};
}