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
@@ -6,15 +6,16 @@
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
common = config.selfhosted.common;
|
||||
cfg = config.selfhosted.zapret2;
|
||||
socksPort = "${toString cfg.socksPort}";
|
||||
ssPort = "${toString cfg.ssPort}";
|
||||
rootCfg = config.selfhosted;
|
||||
common = rootCfg.common;
|
||||
moduleCfg = rootCfg.zapret2;
|
||||
socksPort = "${toString moduleCfg.socksPort}";
|
||||
ssPort = "${toString moduleCfg.ssPort}";
|
||||
configFiles = import ./config.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
options.selfhosted.zapret2 = {
|
||||
enable = mkEnableOption "Enable ${cfg.targetName}";
|
||||
enable = mkEnableOption "Enable ${moduleCfg.targetName}";
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
@@ -26,8 +27,8 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.oci-containers.containers.${cfg.name} = {
|
||||
config = mkIf moduleCfg.enable {
|
||||
virtualisation.oci-containers.containers.${moduleCfg.name} = {
|
||||
image = "docker.io/vernette/ss-zapret2:v0.9.5";
|
||||
volumes = [
|
||||
"${configFiles.config}:/opt/zapret2/config"
|
||||
@@ -49,7 +50,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."${common.backend}-${cfg.name}" = {
|
||||
systemd.services."${common.backend}-${moduleCfg.name}" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "always";
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user