Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -5,8 +5,9 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
cfg = config.selfhosted.mihomo;
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.mihomo;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
@@ -15,21 +16,21 @@ in
|
||||
];
|
||||
|
||||
options.selfhosted.mihomo = {
|
||||
enable = mkEnableOption "Enable ${cfg.targetName} root target";
|
||||
enable = mkEnableOption "Enable ${moduleCfg.targetName} root target";
|
||||
targetName = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = mkIf moduleCfg.enable {
|
||||
sops.secrets = {
|
||||
"mihomo/subscription_url" = { };
|
||||
"mihomo/secret" = { };
|
||||
};
|
||||
|
||||
systemd.targets."${common.backend}-${cfg.targetName}" = {
|
||||
systemd.targets."${common.backend}-${moduleCfg.targetName}" = {
|
||||
unitConfig = {
|
||||
Description = "Root target for ${cfg.targetName}";
|
||||
Description = "Root target for ${moduleCfg.targetName}";
|
||||
};
|
||||
wantedBy = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
||||
partOf = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
||||
@@ -39,8 +40,8 @@ in
|
||||
# set proxy for build time
|
||||
systemd.services.nix-daemon =
|
||||
let
|
||||
mihomoService = "${common.backend}-${cfg.core.name}.service";
|
||||
socksPort = "${toString cfg.core.hostMixedPort}";
|
||||
mihomoService = "${common.backend}-${moduleCfg.core.name}.service";
|
||||
socksPort = "${toString moduleCfg.core.hostMixedPort}";
|
||||
in
|
||||
{
|
||||
after = [ "${mihomoService}" ];
|
||||
|
||||
Reference in new issue
Block a user