Files
nixos-setup/modules/network-drives.nix
T
2025-02-17 21:49:20 -05:00

53 lines
1.2 KiB
Nix

{ lib
, config
, ...
}:
let
cfg = config.skyg.networkDrives;
in
{
options = {
skyg.networkDrives = {
enable = lib.mkEnableOption
"Network Drives";
tnasHost = lib.mkOption {
type = lib.types.str;
default = "tnas1.lab.internal";
};
terraHost = lib.mkOption {
type = lib.types.str;
default = "terra1.lab.internal";
};
options = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [ "defaults" ];
};
};
};
config = lib.mkIf cfg.enable {
fileSystems."/torrents" = {
device = "${cfg.tnasHost}:/mnt/EightTerra/DownloadedTorrents";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/EightTerra/k3s-cluster" = {
device = "${cfg.tnasHost}:/mnt/EightTerra/k3s-cluster";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/EightTerra/NVR" = {
device = "${cfg.tnasHost}:/mnt/EightTerra/NVR";
fsType = "nfs";
options = cfg.options;
};
fileSystems."/mnt/terra1/Data/apps" = {
device = "${cfg.terraHost}:/mnt/Data/apps";
fsType = "nfs";
options = cfg.options;
};
};
}