mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
poweralertd: fix regression
This fixes a regression introduced in
8d7e352a4b
. That commit made the false
assumption that utils would have propagated from Nixpkgs to Home
Manager. This commit copies in `escapeSystemdExecArgs` to fix the
immediate issue, perhaps we can pull this in some other way later down
the line.
This commit is contained in:
parent
dfe4d334b1
commit
51e1d69f7a
1 changed files with 17 additions and 3 deletions
|
@ -2,8 +2,22 @@
|
|||
|
||||
with lib;
|
||||
|
||||
let cfg = config.services.poweralertd;
|
||||
|
||||
let
|
||||
inherit (lib.strings) toJSON;
|
||||
cfg = config.services.poweralertd;
|
||||
escapeSystemdExecArg = arg:
|
||||
let
|
||||
s = if isPath arg then
|
||||
"${arg}"
|
||||
else if isString arg then
|
||||
arg
|
||||
else if isInt arg || isFloat arg || isDerivation arg then
|
||||
toString arg
|
||||
else
|
||||
throw
|
||||
"escapeSystemdExecArg only allows strings, paths, numbers and derivations";
|
||||
in replaceStrings [ "%" "$" ] [ "%%" "$$" ] (toJSON s);
|
||||
escapeSystemdExecArgs = concatMapStringsSep " " escapeSystemdExecArg;
|
||||
in {
|
||||
meta.maintainers = [ maintainers.thibautmarty ];
|
||||
|
||||
|
@ -39,7 +53,7 @@ in {
|
|||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.poweralertd}/bin/poweralertd ${
|
||||
utils.escapeSystemdExecArgs cfg.extraArgs
|
||||
escapeSystemdExecArgs cfg.extraArgs
|
||||
}";
|
||||
Restart = "always";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue