1
1
Fork 0

Set up ZFS mounts and bind mounts

The ZFS datasets here had non-legacy mountpoints, so they were being imported by ZFS itself because of the extraPools setting in default.nix. Mounting them in the NixOS config required setting them to mountpoint=legacy; otherwise, the mount fails and systemd goes into emergency mode.
This commit is contained in:
Tim Van Baak 2024-11-19 06:06:12 +00:00
parent 5b1779eda2
commit efd06d6dde
1 changed files with 24 additions and 35 deletions

View File

@ -1,50 +1,39 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
let
zfsMount = dev: { device = dev; fsType = "zfs"; options = [ "nofail" ]; };
bindMount = dev: { device = dev; options = [ "bind" "nofail" ]; };
in
{ {
# Core filesystems fileSystems = {
fileSystems."/" = # Core filesystems
{ device = "/dev/disk/by-uuid/75addc56-2a0d-431e-a0c5-f6ee0e370e61"; "/" = {
device = "/dev/disk/by-uuid/75addc56-2a0d-431e-a0c5-f6ee0e370e61";
fsType = "ext4"; fsType = "ext4";
}; };
"/boot" = {
fileSystems."/boot" = device = "/dev/disk/by-uuid/610F-1EB7";
{ device = "/dev/disk/by-uuid/610F-1EB7";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ]; options = [ "fmask=0022" "dmask=0022" ];
}; };
# ZFS filesystems # ZFS filesystems
fileSystems."/pool/tvb" = "/pool/tvb" = zfsMount "pool/user/tvb";
{ device = "pool/user/tvb";
fsType = "zfs";
};
fileSystems."/pool/tvb/doc" = "/home/tvb/doc" = zfsMount "pool/user/tvb/doc";
{ device = "pool/user/tvb/doc"; "/pool/tvb/doc" = bindMount "/home/tvb/doc";
fsType = "zfs";
};
fileSystems."/pool/tvb/game" = "/home/tvb/game" = zfsMount "pool/user/tvb/game";
{ device = "pool/user/tvb/game"; "/pool/tvb/game" = bindMount "/home/tvb/game";
fsType = "zfs";
};
fileSystems."/pool/tvb/video" = "/home/tvb/video" = zfsMount "pool/user/tvb/video";
{ device = "pool/user/tvb/video"; "/pool/tvb/video" = bindMount "/home/tvb/video";
fsType = "zfs";
};
fileSystems."/pool/tvb/audio" = "/home/tvb/audio" = zfsMount "pool/user/tvb/audio";
{ device = "pool/user/tvb/audio"; "/pool/tvb/audio" = bindMount "/home/tvb/audio";
fsType = "zfs";
};
fileSystems."/pool/tvb/image" = "/home/tvb/image" = zfsMount "pool/user/tvb/image";
{ device = "pool/user/tvb/image"; "/pool/tvb/image" = bindMount "/home/tvb/image";
fsType = "zfs"; };
};
swapDevices = swapDevices = [ { device = "/dev/disk/by-uuid/cc464bb4-e1c8-46c0-adbb-ea1a3cfa5b03"; } ];
[ { device = "/dev/disk/by-uuid/cc464bb4-e1c8-46c0-adbb-ea1a3cfa5b03"; }
];
} }