52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
|
|
|
|
let
|
|
cfg = config.modules.homelab;
|
|
in
|
|
{
|
|
options.modules.homelab = {
|
|
enable = lib.mkEnableOption "enable homelab services and configuration";
|
|
media_user = lib.mkOption {
|
|
default = "media";
|
|
type = lib.types.str;
|
|
description = "user for media file permissions";
|
|
};
|
|
media_group = lib.mkOption {
|
|
default = "media";
|
|
type = lib.types.str;
|
|
description = "group for media file permissions";
|
|
};
|
|
tz = lib.mkOption {
|
|
default = "America/Chicago";
|
|
type = lib.types.str;
|
|
description = "set timezone";
|
|
};
|
|
base_domain = lib.mkOption {
|
|
default = "snowbelle.lan";
|
|
type = lib.types.str;
|
|
description = "base domain used for reverse proxy";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
./services
|
|
./shares/nfs.nix
|
|
./shares/smb.nix
|
|
./shares/zfs.nix
|
|
];
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
users = {
|
|
groups.${cfg.media_group} = {
|
|
gid = 700;
|
|
};
|
|
users.${cfg.media_user} = {
|
|
uid = 700;
|
|
isSystemUser = true;
|
|
group = cfg.media_group;
|
|
};
|
|
};
|
|
};
|
|
}
|