From 14ac6d3bba12f07bd8aa79221b9c64469fe03046 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 22 Jul 2015 19:25:51 +0200 Subject: * tv: regen ids --- 3modules/tv/urlwatch.nix | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to '3modules/tv/urlwatch.nix') diff --git a/3modules/tv/urlwatch.nix b/3modules/tv/urlwatch.nix index 05a0b0faf..a659fc74f 100644 --- a/3modules/tv/urlwatch.nix +++ b/3modules/tv/urlwatch.nix @@ -28,7 +28,7 @@ let }; from = mkOption { type = types.str; - default = "${cfg.user}@${config.networking.hostName}.retiolum"; + default = "${user.name}@${config.networking.hostName}.retiolum"; description = '' Content of the From: header of the generated mails. ''; @@ -54,11 +54,6 @@ let https://nixos.org/channels/nixos-unstable/git-revision ]; }; - user = mkOption { - type = types.str; - default = "urlwatch"; - description = "User under which urlwatch runs."; - }; }; urlsFile = toFile "urls" (concatStringsSep "\n" cfg.urls); @@ -84,7 +79,7 @@ let SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; }; serviceConfig = { - User = cfg.user; + User = user.name; PermissionsStartOnly = "true"; PrivateTmp = "true"; Type = "oneshot"; @@ -94,11 +89,10 @@ let set -euf dataDir=$HOME - user=${escapeShellArg cfg.user} if ! test -e "$dataDir"; then mkdir -m 0700 -p "$dataDir" - chown "$user": "$dataDir" + chown ${user.name}: "$dataDir" fi ''; ExecStart = pkgs.writeScript "urlwatch" '' @@ -108,7 +102,6 @@ let from=${escapeShellArg cfg.from} mailto=${escapeShellArg cfg.mailto} urlsFile=${escapeShellArg urlsFile} - user=${escapeShellArg cfg.user} cd /tmp @@ -130,11 +123,14 @@ let ''; }; }; - users.extraUsers = optionals (cfg.user == "urlwatch") (singleton { - name = "urlwatch"; - uid = 3450919516; # bin/genid urlwatch - }); + users.extraUsers = singleton { + inherit (user) name uid; + }; }; + user = { + name = "urlwatch"; + uid = 3467631196; # genid urlwatch + }; in out -- cgit v1.2.3