From 884190a23837936813a33a4ae4bdc4c5ee58f349 Mon Sep 17 00:00:00 2001 From: Pascal Wittmann Date: Tue, 11 Feb 2014 14:19:06 +0100 Subject: [PATCH] nixos: add uid for logcheck and only create a user for the default user --- nixos/modules/misc/ids.nix | 1 + nixos/modules/services/logging/logcheck.nix | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 5f8111eb986..6d833551604 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -111,6 +111,7 @@ memcached = 100; cgminer = 101; munin = 102; + logcheck = 103; # When adding a uid, make sure it doesn't match an existing gid. diff --git a/nixos/modules/services/logging/logcheck.nix b/nixos/modules/services/logging/logcheck.nix index 2a6a6516f48..ef147f95358 100644 --- a/nixos/modules/services/logging/logcheck.nix +++ b/nixos/modules/services/logging/logcheck.nix @@ -208,12 +208,13 @@ in mapAttrsToList writeIgnoreRule cfg.ignore ++ mapAttrsToList writeIgnoreCronRule cfg.ignoreCron; - users.extraUsers = singleton - { name = cfg.user; + users.extraUsers = optionalAttrs (cfg.user == "logcheck") (singleton + { name = "logcheck"; + uid = config.ids.uids.logcheck; shell = "/bin/sh"; description = "Logcheck user account"; extraGroups = cfg.extraGroups; - }; + }); system.activationScripts.logcheck = '' mkdir -m 700 -p /var/{lib,lock}/logcheck