mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-10 20:20:41 +03:00
40 lines
864 B
Nix
40 lines
864 B
Nix
{
|
|
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;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|