fix(cloudflared): explicit user

This commit is contained in:
arcnmx 2025-09-17 14:32:14 -07:00
parent d80fd6fd5f
commit e0fe5bcd6f
4 changed files with 22 additions and 6 deletions

View file

@ -2,9 +2,11 @@ let
tunnelModule = {
pkgs,
config,
gensokyo-zone,
lib,
...
}: let
inherit (gensokyo-zone.lib) unmerged;
inherit (lib.options) mkOption mkEnableOption;
settingsFormat = pkgs.formats.json {};
in {
@ -24,6 +26,10 @@ let
default = {};
};
};
systemd.extraServiceSettings = mkOption {
type = unmerged.types.attrs;
default = {};
};
};
};
in
@ -35,6 +41,7 @@ in
lib,
...
}: let
inherit (gensokyo-zone.lib) unmerged;
inherit (lib.attrsets) mapAttrsToList mapAttrs' nameValuePair filterAttrsRecursive;
inherit (lib.lists) singleton;
inherit (lib.modules) mkIf mkMerge mkForce;
@ -63,6 +70,10 @@ in
};
});
};
systemd.extraServiceSettings = mkOption {
type = unmerged.types.attrs;
default = {};
};
};
config.services.cloudflared = {
extraArgs = mkIf (cfg.metricsPort != null) [
@ -112,6 +123,8 @@ in
];
};
}
(unmerged.mergeAttrs tunnel.systemd.extraServiceSettings)
(unmerged.mergeAttrs cfg.systemd.extraServiceSettings)
(mkIf tunnel.extraTunnel.enable {
serviceConfig = {
inherit RuntimeDirectory;