mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
nixos/nats: Implemented configuration verification
This commit is contained in:
parent
2789cee804
commit
5ea0207b73
@ -10,6 +10,13 @@ let
|
||||
|
||||
configFile = format.generate "nats.conf" cfg.settings;
|
||||
|
||||
validateConfig = file:
|
||||
pkgs.runCommand "validate-nats-conf" {
|
||||
nativeBuildInputs = [ pkgs.nats-server ];
|
||||
} ''
|
||||
nats-server --config "${configFile}" -t
|
||||
ln -s "${configFile}" "$out"
|
||||
'';
|
||||
in {
|
||||
|
||||
### Interface
|
||||
@ -104,7 +111,7 @@ in {
|
||||
})
|
||||
{
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.nats-server}/bin/nats-server -c ${configFile}";
|
||||
ExecStart = "${pkgs.nats-server}/bin/nats-server -c ${validateConfig configFile}";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
ExecStop = "${pkgs.coreutils}/bin/kill -SIGINT $MAINPID";
|
||||
Restart = "on-failure";
|
||||
|
Loading…
Reference in New Issue
Block a user