mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-10 12:16:32 +03:00
systemd-routine - prebuild
This commit is contained in:
@@ -77,10 +77,10 @@ let
|
||||
nameservers = [
|
||||
"1.1.1.1"
|
||||
"8.8.8.8"
|
||||
"2001:4860:4860::8844"
|
||||
"2001:4860:4860::8888"
|
||||
"2606:4700:4700::1111"
|
||||
"2606:4700:4700::1001"
|
||||
# "2001:4860:4860::8844"
|
||||
# "2001:4860:4860::8888"
|
||||
# "2606:4700:4700::1111"
|
||||
# "2606:4700:4700::1001"
|
||||
];
|
||||
hostName = "${xlib.device.hostname}";
|
||||
networkmanager.enable = true;
|
||||
@@ -115,7 +115,7 @@ let
|
||||
}
|
||||
'';
|
||||
};
|
||||
enableIPv6 = true;
|
||||
enableIPv6 = false;
|
||||
interfaces.ens3 = {
|
||||
useDHCP = true;
|
||||
# ipv4.addresses = [
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
./packages.nix
|
||||
./services.nix
|
||||
./settings.nix
|
||||
# ./systemd-routine.nix
|
||||
./systemd-routines.nix
|
||||
./shell.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ in
|
||||
flake = "/etc/nixos";
|
||||
clean = {
|
||||
enable = true;
|
||||
extraArgs = "--keep 3 --keep-since 2d";
|
||||
extraArgs = "--keep 2 --keep-since 2d";
|
||||
dates = "daily";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
config,
|
||||
xlib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd = {
|
||||
services.nixos-auto-rebuild = {
|
||||
description = "Auto rebuild NixOS config";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "${xlib.device.username}";
|
||||
WorkingDirectory = "/etc/nixos";
|
||||
ExecStart = "gp-ns";
|
||||
};
|
||||
};
|
||||
timers.nixos-auto-rebuild = {
|
||||
description = "Run NixOS auto rebuild at 4am daily";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 04:00:00";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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