Fix config deploy script
This commit is contained in:
parent
37b15f461a
commit
8cf92a4415
|
@ -40,13 +40,8 @@ let
|
||||||
${pkgs.test-system-config}/bin/test-system-config $REPODIR ${host}
|
${pkgs.test-system-config}/bin/test-system-config $REPODIR ${host}
|
||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
deployCommand = "${let user = "maralorn";
|
deployCommand = "${pkgs.writeShellScript "deploy-system-config"
|
||||||
in pkgs.writeShellScript "deploy-system-config" ''
|
"${pkgs.systemd}/bin/systemctl start update-config"}";
|
||||||
/run/wrappers/bin/sudo -u ${user} git -C /etc/nixos pull --ff-only
|
|
||||||
/run/wrappers/bin/sudo -u ${user} git -C /etc/nixos submodule update --init
|
|
||||||
/var/cache/gc-links/result-system-hera/bin/switch-to-configuration switch
|
|
||||||
/run/wrappers/bin/sudo -u ${user} /var/cache/gc-links/result-home-manager-hera/default/activate
|
|
||||||
''}";
|
|
||||||
in {
|
in {
|
||||||
services.laminar.cfgFiles.jobs = {
|
services.laminar.cfgFiles.jobs = {
|
||||||
"test-config.run" = pkgs.writeHaskell "test-config" {
|
"test-config.run" = pkgs.writeHaskell "test-config" {
|
||||||
|
@ -73,11 +68,34 @@ in {
|
||||||
}];
|
}];
|
||||||
users = [ "laminar" ];
|
users = [ "laminar" ];
|
||||||
}];
|
}];
|
||||||
systemd.services.bump-config = {
|
systemd.services = {
|
||||||
startAt = "03:45";
|
update-config = {
|
||||||
serviceConfig = {
|
path = [ pkgs.git pkgs.nix ];
|
||||||
Type = "oneshot";
|
restartIfChanged = false;
|
||||||
ExecStart = "${pkgs.laminar}/bin/laminarc queue bump-config";
|
unitConfig.X-StopOnRemoval = false;
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 1;
|
||||||
|
};
|
||||||
|
unitConfig = {
|
||||||
|
StartLimitIntervalSec = 180;
|
||||||
|
StartLimitBurst = 3;
|
||||||
|
};
|
||||||
|
script = let user = "maralorn";
|
||||||
|
in ''
|
||||||
|
/run/wrappers/bin/sudo -u ${user} git -C /etc/nixos pull --ff-only
|
||||||
|
/run/wrappers/bin/sudo -u ${user} git -C /etc/nixos submodule update --init
|
||||||
|
/var/cache/gc-links/result-system-hera/bin/switch-to-configuration switch
|
||||||
|
/run/wrappers/bin/sudo -u ${user} /var/cache/gc-links/result-home-manager-hera/default/activate
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
bump-config = {
|
||||||
|
startAt = "03:45";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = "${pkgs.laminar}/bin/laminarc queue bump-config";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue