36 lines
924 B
Nix
36 lines
924 B
Nix
{ config, lib, ... }:
|
|
with lib;
|
|
let
|
|
rootCfg = config.selfhosted;
|
|
common = rootCfg.common;
|
|
moduleCfg = rootCfg.homarr;
|
|
in
|
|
{
|
|
imports = [ ./server ];
|
|
|
|
options.selfhosted.homarr = {
|
|
enable = mkEnableOption "Enable ${moduleCfg.targetName} root target";
|
|
targetName = mkOption {
|
|
type = types.str;
|
|
};
|
|
};
|
|
|
|
config = mkIf moduleCfg.enable {
|
|
sops.secrets = {
|
|
"homarr/enc_key" = { };
|
|
"homarr/client_id" = { };
|
|
"homarr/client_secret" = { };
|
|
"homarr/nextauth_secret" = { };
|
|
};
|
|
|
|
systemd.targets."${common.backend}-${moduleCfg.targetName}" = {
|
|
unitConfig = {
|
|
Description = "Root target for ${moduleCfg.targetName}";
|
|
};
|
|
wantedBy = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
partOf = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
after = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
};
|
|
};
|
|
}
|