mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-11 04:30:41 +03:00
systemd-routine - prebuild
This commit is contained in:
@@ -77,10 +77,10 @@ let
|
|||||||
nameservers = [
|
nameservers = [
|
||||||
"1.1.1.1"
|
"1.1.1.1"
|
||||||
"8.8.8.8"
|
"8.8.8.8"
|
||||||
"2001:4860:4860::8844"
|
# "2001:4860:4860::8844"
|
||||||
"2001:4860:4860::8888"
|
# "2001:4860:4860::8888"
|
||||||
"2606:4700:4700::1111"
|
# "2606:4700:4700::1111"
|
||||||
"2606:4700:4700::1001"
|
# "2606:4700:4700::1001"
|
||||||
];
|
];
|
||||||
hostName = "${xlib.device.hostname}";
|
hostName = "${xlib.device.hostname}";
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
@@ -115,7 +115,7 @@ let
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
enableIPv6 = true;
|
enableIPv6 = false;
|
||||||
interfaces.ens3 = {
|
interfaces.ens3 = {
|
||||||
useDHCP = true;
|
useDHCP = true;
|
||||||
# ipv4.addresses = [
|
# ipv4.addresses = [
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
./packages.nix
|
./packages.nix
|
||||||
./services.nix
|
./services.nix
|
||||||
./settings.nix
|
./settings.nix
|
||||||
# ./systemd-routine.nix
|
./systemd-routines.nix
|
||||||
./shell.nix
|
./shell.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ in
|
|||||||
flake = "/etc/nixos";
|
flake = "/etc/nixos";
|
||||||
clean = {
|
clean = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraArgs = "--keep 3 --keep-since 2d";
|
extraArgs = "--keep 2 --keep-since 2d";
|
||||||
dates = "daily";
|
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