- printing role: Add configurable printerName, printerUri, and printerModel options to replace hardcoded Brother printer values - nfs-mounts role: Add configurable server, remotePath, and mountPoint options to replace hardcoded NFS server IP (10.0.0.43) - virtualisation role: Add configurable dockerUsers option as list type to replace hardcoded 'johno' docker group membership All options have sensible defaults matching the original hardcoded values, ensuring backward compatibility while allowing per-host customization. Implements bead: nixos-configs-fkt
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.roles.nfs-mounts;
|
|
in
|
|
{
|
|
options.roles.nfs-mounts = {
|
|
enable = mkEnableOption "Enable default NFS mounts";
|
|
server = mkOption {
|
|
type = types.str;
|
|
default = "10.0.0.43";
|
|
description = "IP address or hostname of the NFS server";
|
|
};
|
|
remotePath = mkOption {
|
|
type = types.str;
|
|
default = "/media";
|
|
description = "Remote path to mount from the NFS server";
|
|
};
|
|
mountPoint = mkOption {
|
|
type = types.str;
|
|
default = "/media";
|
|
description = "Local mount point for the NFS share";
|
|
};
|
|
# TODO: implement requireMount
|
|
requireMount = mkOption {
|
|
type = types.bool;
|
|
description = "Hard fail if the NFS mounts are not available";
|
|
default = false;
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable
|
|
{
|
|
fileSystems.${cfg.mountPoint} = {
|
|
device = "${cfg.server}:${cfg.remotePath}";
|
|
fsType = "nfs";
|
|
options = [
|
|
"defaults"
|
|
"nofail"
|
|
"softreval"
|
|
];
|
|
};
|
|
};
|
|
}
|