60 lines
1.2 KiB
Nix
60 lines
1.2 KiB
Nix
|
{
|
||
|
inputs,
|
||
|
config,
|
||
|
lib,
|
||
|
pkgs,
|
||
|
system,
|
||
|
...
|
||
|
}:
|
||
|
let
|
||
|
cfg = config.suites.nas;
|
||
|
in
|
||
|
{
|
||
|
imports = [
|
||
|
./jellyfin.nix
|
||
|
./kavita.nix
|
||
|
];
|
||
|
options.suites.nas.enable = lib.mkOption {
|
||
|
type = with lib.types; uniq bool;
|
||
|
default = false;
|
||
|
description = "Enable Preconfigured NAS Config";
|
||
|
};
|
||
|
options.suites.nas.domain = lib.mkOption {
|
||
|
type = with lib.types; string;
|
||
|
default = "localhost";
|
||
|
description = "NAS Reachable Domain Name";
|
||
|
};
|
||
|
options.suites.nas.media.enable = lib.mkOption {
|
||
|
type = with lib.types; uniq bool;
|
||
|
default = true;
|
||
|
description = "Enable Media Servers";
|
||
|
};
|
||
|
options.suites.nas.media.folder = lib.mkOption {
|
||
|
type = with lib.types; str;
|
||
|
default = "/home/media/media";
|
||
|
description = "Media Root Directory";
|
||
|
};
|
||
|
|
||
|
# Media Config
|
||
|
config = lib.mkIf (cfg.enable && cfg.media.enable) {
|
||
|
|
||
|
# Media Defaults
|
||
|
suites.nas.media.jellyfin.enable = true;
|
||
|
suites.nas.media.kavita.enable = false;
|
||
|
|
||
|
# Create Media User
|
||
|
users.groups.media = {};
|
||
|
users.users.media = {
|
||
|
isSystemUser = true;
|
||
|
createHome = true;
|
||
|
description = "Media User";
|
||
|
group = "media";
|
||
|
home = "/home/media";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
|
||
|
}
|
||
|
|