chore: split nixos and opentofu
This commit is contained in:
parent
d125848b82
commit
06500a8f01
68 changed files with 44 additions and 61 deletions
|
|
@ -1,46 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.homelab.nfsMounts = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule {
|
||||
options = {
|
||||
device = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "The NFS device, e.g. 192.168.0.11:/mnt/POOL/DATA";
|
||||
};
|
||||
readOnly = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to mount the NFS share read-only";
|
||||
};
|
||||
extraOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [
|
||||
"async"
|
||||
"soft"
|
||||
"timeo=100"
|
||||
"retry=50"
|
||||
"actimeo=1800"
|
||||
"lookupcache=all"
|
||||
];
|
||||
description = "Extra NFS mount options to append";
|
||||
};
|
||||
};
|
||||
});
|
||||
default = {};
|
||||
description = "NFS mounts to automatically configure with standard homelab options";
|
||||
};
|
||||
|
||||
config = {
|
||||
fileSystems = lib.mapAttrs (path: cfg: {
|
||||
device = cfg.device;
|
||||
fsType = "nfs";
|
||||
options = [
|
||||
"nfsvers=4.2"
|
||||
"nosuid"
|
||||
"tcp"
|
||||
] ++ (if cfg.readOnly then [ "ro" ] else [ "rw" ])
|
||||
++ cfg.extraOptions;
|
||||
}) config.homelab.nfsMounts;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue