nixos/prometheus-exporters: fix unapplied service config

Prior to this commit, the default values for `Restart`, `PrivateTmp` and
`WorkingDirectory` were falsely ignored.

I also added myself as maintainer.
This commit is contained in:
WilliButz 2018-10-08 16:30:53 +02:00
parent 24320f4a9e
commit fbb7e0c82f
No known key found for this signature in database
GPG key ID: 92582A10F1179CB2

View file

@ -123,15 +123,13 @@ let
systemd.services."prometheus-${name}-exporter" = mkMerge ([{
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
Restart = mkDefault "always";
PrivateTmp = mkDefault true;
WorkingDirectory = mkDefault /tmp;
} // mkIf (!(serviceOpts.serviceConfig.DynamicUser or false)) {
User = conf.user;
Group = conf.group;
};
} serviceOpts ]);
serviceConfig.Restart = mkDefault "always";
serviceConfig.PrivateTmp = mkDefault true;
serviceConfig.WorkingDirectory = mkDefault /tmp;
} serviceOpts ] ++ optional (serviceOpts.serviceConfig.DynamicUser or false) {
serviceConfig.User = conf.user;
serviceConfig.Group = conf.group;
});
};
in
{
@ -172,5 +170,8 @@ in
}) exporterOpts)
);
meta.doc = ./exporters.xml;
meta = {
doc = ./exporters.xml;
maintainers = [ maintainers.willibutz ];
};
}