From 5bd58d4305c24b1ca67734435f349732f9e0dbb7 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Fri, 2 Aug 2019 05:20:43 +0200 Subject: [PATCH] Change system-update-job --- system/git.nix | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/system/git.nix b/system/git.nix index 128b0163..0ac38e4b 100644 --- a/system/git.nix +++ b/system/git.nix @@ -2,10 +2,12 @@ let inherit (import ../lib) writeHaskellScript haskellList; me = config.m-0.private.me; - test-command = - [ "${pkgs.systemd}/bin/systemctl" "start" "test-and-bump-config.service" ]; - upgrade-command = - [ "${pkgs.systemd}/bin/systemctl" "start" "system-maintenance.service" ]; + update-command = [ + "${pkgs.systemd}/bin/systemctl" + "start" + "test-and-update.service" + "--no-block" + ]; post-update = writeHaskellScript { name = "post-update"; bins = [ pkgs.git pkgs.nix ]; @@ -23,25 +25,17 @@ let echo "Done" test <- lookupEnv "GL_OPTION_TEST" for_ test $ \_ -> do - echo "Triggering a system update … You can wait or disconnect"; - exe "sudo" ${haskellList test-command}; - exe "sudo" ${haskellList upgrade-command}; - echo "Done"; + echo "Triggering (an async) system update." + exe "sudo" ${haskellList update-command}; ''; in { users.users.git.linger = true; # Frequent restarting of the systemd-user-unit leads to errors security.sudo.extraRules = [{ - commands = [ - { - command = builtins.concatStringsSep " " test-command; - options = [ "NOPASSWD" ]; - } - { - command = builtins.concatStringsSep " " upgrade-command; - options = [ "NOPASSWD" ]; - } - ]; + commands = [{ + command = builtins.concatStringsSep " " update-command; + options = [ "NOPASSWD" ]; + }]; users = [ "git" ]; }]; services.gitolite = {