git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/prometheus/alertmanager: use DynamicUser instead of nobody

See issue #55370

commitcd4486ecc3a4ce0e4c8ec3ce87945f581f0a6037 authorBas van Dijk <v.dijk.bas@gmail.com> dateWed 10 Apr 2019, 17:12 (8 years ago) parent08d9cf7
3 files changed+12−19
nixos/doc/manual/release-notes/rl-1909.xml+9 nixos/modules/rename.nix+2 nixos/modules/services/monitoring/prometheus/alertmanager.nix+1−19
nixos/doc/manual/release-notes/rl-1909.xml+9
@@ -101,6 +101,15 @@
101101 <option>services.prometheus.stateDir</option> at the same time.
102102 </para>
103103 </listitem>
104+ <listitem>
105+ <para>
106+ The options <option>services.prometheus.alertmanager.user</option> and
107+ <option>services.prometheus.alertmanager.group</option> have been removed
108+ because the alertmanager service is now using systemd's <link
109+ xlink:href="http://0pointer.net/blog/dynamic-users-with-systemd.html">
110+ DynamicUser mechanism</link> which obviates these options.
111+ </para>
112+ </listitem>
104113 </itemizedlist>
105114 </section>
106115
nixos/modules/rename.nix+2
@@ -45,6 +45,8 @@ with lib;
4545 (mkRemovedOptionModule [ "services" "neo4j" "port" ] "Use services.neo4j.http.listenAddress instead.")
4646 (mkRemovedOptionModule [ "services" "neo4j" "boltPort" ] "Use services.neo4j.bolt.listenAddress instead.")
4747 (mkRemovedOptionModule [ "services" "neo4j" "httpsPort" ] "Use services.neo4j.https.listenAddress instead.")
48+ (mkRemovedOptionModule [ "services" "prometheus" "alertmanager" "user" ] "The alertmanager service is now using systemd's DynamicUser mechanism which obviates a user setting.")
49+ (mkRemovedOptionModule [ "services" "prometheus" "alertmanager" "group" ] "The alertmanager service is now using systemd's DynamicUser mechanism which obviates a group setting.")
4850 (mkRenamedOptionModule [ "services" "tor" "relay" "portSpec" ] [ "services" "tor" "relay" "port" ])
4951 (mkRenamedOptionModule [ "services" "vmwareGuest" ] [ "virtualisation" "vmware" "guest" ])
5052 (mkRenamedOptionModule [ "jobs" ] [ "systemd" "services" ])
nixos/modules/services/monitoring/prometheus/alertmanager.nix+1−19
@@ -40,22 +40,6 @@ in {
4040 '';
4141 };
4242
43− user = mkOption {
44− type = types.str;
45− default = "nobody";
46− description = ''
47− User name under which Alertmanager shall be run.
48− '';
49− };
50−
51− group = mkOption {
52− type = types.str;
53− default = "nogroup";
54− description = ''
55− Group under which Alertmanager shall be run.
56− '';
57− };
58−
5943 configuration = mkOption {
6044 type = types.nullOr types.attrs;
6145 default = null;
@@ -152,10 +136,8 @@ in {
152136 wantedBy = [ "multi-user.target" ];
153137 after = [ "network.target" ];
154138 serviceConfig = {
155− User = cfg.user;
156− Group = cfg.group;
157139 Restart = "always";
158− PrivateTmp = true;
140+ DynamicUser = true;
159141 WorkingDirectory = "/tmp";
160142 ExecStart = "${cfg.package}/bin/alertmanager" +
161143 optionalString (length cmdlineArgs != 0) (" \\\n " +