flakes/hosts/blossom/filesystem.nix

51 lines
1.5 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/hdd" = mkMount "d5e3cfe5-c73a-4695-b81b-fc0215d4cefe" "ext4";
2021-11-02 00:53:56 +07:00
"/mnt/prev" = mkMount "8f0ba28e-5dff-4a4e-8db0-aa72cc90cb5d" "btrfs" // {
options = [ "autodefrag" "compress=zstd:3" "defaults" "nossd" "noatime" "ro" ];
};
"/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;
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" ];
# };
2021-08-22 14:50:28 +07:00
"/mnt/apricot" = {
device = "rin@apricot:/";
fsType = "fuse.sshfs";
options = [
"noauto"
"x-systemd.automount"
"_netdev"
"IdentityFile=/home/rin/.ssh/id_rsa"
"allow_other"
"reconnect"
];
};
};
}