mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-11 12:40:44 +03:00
systemd-routine - prebuild
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd = {
|
||||
services = {
|
||||
nixos-prebuild = {
|
||||
description = "Prebuild NixOS closure";
|
||||
serviceConfig = {
|
||||
CPUQuota = "20%";
|
||||
User = "oqyude";
|
||||
Group = "users";
|
||||
Nice = 10;
|
||||
Type = "oneshot";
|
||||
WorkingDirectory = "/tmp";
|
||||
Environment = [
|
||||
"HOME=/home/oqyude"
|
||||
];
|
||||
ExecStart = ''
|
||||
${pkgs.nix}/bin/nix build --no-link /etc/nixos#nixosConfigurations.${config.networking.hostName}.config.system.build.toplevel
|
||||
'';
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
timers = {
|
||||
nixos-prebuild = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 04:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user