Change system-update-job
This commit is contained in:
parent
351363b58f
commit
5bd58d4305
1 changed files with 12 additions and 18 deletions
|
@ -2,10 +2,12 @@
|
||||||
let
|
let
|
||||||
inherit (import ../lib) writeHaskellScript haskellList;
|
inherit (import ../lib) writeHaskellScript haskellList;
|
||||||
me = config.m-0.private.me;
|
me = config.m-0.private.me;
|
||||||
test-command =
|
update-command = [
|
||||||
[ "${pkgs.systemd}/bin/systemctl" "start" "test-and-bump-config.service" ];
|
"${pkgs.systemd}/bin/systemctl"
|
||||||
upgrade-command =
|
"start"
|
||||||
[ "${pkgs.systemd}/bin/systemctl" "start" "system-maintenance.service" ];
|
"test-and-update.service"
|
||||||
|
"--no-block"
|
||||||
|
];
|
||||||
post-update = writeHaskellScript {
|
post-update = writeHaskellScript {
|
||||||
name = "post-update";
|
name = "post-update";
|
||||||
bins = [ pkgs.git pkgs.nix ];
|
bins = [ pkgs.git pkgs.nix ];
|
||||||
|
@ -23,25 +25,17 @@ let
|
||||||
echo "Done"
|
echo "Done"
|
||||||
test <- lookupEnv "GL_OPTION_TEST"
|
test <- lookupEnv "GL_OPTION_TEST"
|
||||||
for_ test $ \_ -> do
|
for_ test $ \_ -> do
|
||||||
echo "Triggering a system update … You can wait or disconnect";
|
echo "Triggering (an async) system update."
|
||||||
exe "sudo" ${haskellList test-command};
|
exe "sudo" ${haskellList update-command};
|
||||||
exe "sudo" ${haskellList upgrade-command};
|
|
||||||
echo "Done";
|
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
users.users.git.linger =
|
users.users.git.linger =
|
||||||
true; # Frequent restarting of the systemd-user-unit leads to errors
|
true; # Frequent restarting of the systemd-user-unit leads to errors
|
||||||
security.sudo.extraRules = [{
|
security.sudo.extraRules = [{
|
||||||
commands = [
|
commands = [{
|
||||||
{
|
command = builtins.concatStringsSep " " update-command;
|
||||||
command = builtins.concatStringsSep " " test-command;
|
options = [ "NOPASSWD" ];
|
||||||
options = [ "NOPASSWD" ];
|
}];
|
||||||
}
|
|
||||||
{
|
|
||||||
command = builtins.concatStringsSep " " upgrade-command;
|
|
||||||
options = [ "NOPASSWD" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
users = [ "git" ];
|
users = [ "git" ];
|
||||||
}];
|
}];
|
||||||
services.gitolite = {
|
services.gitolite = {
|
||||||
|
|
Loading…
Reference in a new issue