ConditionPathExists can't use env vars.
Use a separate watch job instead.
This commit is contained in:
parent
9a97eb1de7
commit
a52626e237
17
module.nix
17
module.nix
@ -53,7 +53,20 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
nixpkgs.overlays = [ wallfly-overlay ];
|
nixpkgs.overlays = [ wallfly-overlay ];
|
||||||
|
|
||||||
systemd.user.services.wallfly = {
|
systemd.user.services = {
|
||||||
|
wallfly-password-watcher = {
|
||||||
|
requiredBy = [ "wallfly.service" ];
|
||||||
|
before = [ "wallfly.service" ];
|
||||||
|
restartIfChanged = true;
|
||||||
|
serviceConfig = {
|
||||||
|
TimeoutStartSec = 180;
|
||||||
|
ExecStart = pkgs.writeShellScript "watch-wallfly-passwd.sh" ''
|
||||||
|
test -f ${cfg.mqtt.password-file} && sleep 3
|
||||||
|
exit 0
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
wallfly = {
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
after = [ "graphical-session.target" ];
|
after = [ "graphical-session.target" ];
|
||||||
requires = [ "graphical-session.target" ];
|
requires = [ "graphical-session.target" ];
|
||||||
@ -72,7 +85,7 @@ in {
|
|||||||
Restart = "always";
|
Restart = "always";
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
};
|
};
|
||||||
unitConfig.ConditionPathExists = [ cfg.mqtt.password-file ];
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user