git.iko.soy/typeable/nixpkgs
on master help sign in
prometheus exporters: always set user and group

systemd.exec(5) on DynamicUser: > If a statically allocated user or group of the configured name > already exists, it is used and no dynamic user/group is allocated. Using DynamicUser while still setting a group name can be useful for granting access to resources that can otherwise only be accessed with entirely static IDs.

commit2c1e72ee6a2eb2ad5bb58e7d1a8512f6bdc7f8e5 authorLinus Heckemann <git@sphalerite.org> dateTue 29 Sep 2020, 10:46 (6 years ago) parentdaaa0e3
1 file changed+1−4
nixos/modules/services/monitoring/prometheus/exporters.nix+1−4
nixos/modules/services/monitoring/prometheus/exporters.nix+1−4
@@ -101,7 +101,6 @@ let
101101 default = "${name}-exporter";
102102 description = ''
103103 User name under which the ${name} exporter shall be run.
104− Has no effect when <option>systemd.services.prometheus-${name}-exporter.serviceConfig.DynamicUser</option> is true.
105104 '';
106105 };
107106 group = mkOption {
@@ -109,7 +108,6 @@ let
109108 default = "${name}-exporter";
110109 description = ''
111110 Group under which the ${name} exporter shall be run.
112− Has no effect when <option>systemd.services.prometheus-${name}-exporter.serviceConfig.DynamicUser</option> is true.
113111 '';
114112 };
115113 });
@@ -161,10 +159,9 @@ let
161159 serviceConfig.PrivateTmp = mkDefault true;
162160 serviceConfig.WorkingDirectory = mkDefault /tmp;
163161 serviceConfig.DynamicUser = mkDefault enableDynamicUser;
164− } serviceOpts ] ++ optional (!enableDynamicUser) {
165162 serviceConfig.User = conf.user;
166163 serviceConfig.Group = conf.group;
167− });
164+ } serviceOpts ]);
168165 };
169166in
170167{