summaryrefslogtreecommitdiff
path: root/system-profiles
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-03-12 20:55:33 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-03-12 20:55:33 +0100
commitf1b915373750f7bdc09cbdaa011d0f49efea6cc8 (patch)
treec7c34dfe0f40c4fe89f7df1459ddea6cd352ccd1 /system-profiles
parent050381447325aaec8647880f00f906f012ca847b (diff)
downloadnixos-f1b915373750f7bdc09cbdaa011d0f49efea6cc8.tar
nixos-f1b915373750f7bdc09cbdaa011d0f49efea6cc8.tar.gz
nixos-f1b915373750f7bdc09cbdaa011d0f49efea6cc8.tar.bz2
nixos-f1b915373750f7bdc09cbdaa011d0f49efea6cc8.tar.xz
nixos-f1b915373750f7bdc09cbdaa011d0f49efea6cc8.zip
rebuild-machines: period
Diffstat (limited to 'system-profiles')
-rw-r--r--system-profiles/networkmanager.nix2
-rw-r--r--system-profiles/rebuild-machines/default.nix29
2 files changed, 31 insertions, 0 deletions
diff --git a/system-profiles/networkmanager.nix b/system-profiles/networkmanager.nix
index d1eb9cd1..878a12c4 100644
--- a/system-profiles/networkmanager.nix
+++ b/system-profiles/networkmanager.nix
@@ -22,5 +22,7 @@ with lib;
22 systemd.services."systemd-networkd-wait-online".enable = false; 22 systemd.services."systemd-networkd-wait-online".enable = false;
23 23
24 services.resolved.enable = false; 24 services.resolved.enable = false;
25
26 environment.noXlibs = false;
25 }; 27 };
26} 28}
diff --git a/system-profiles/rebuild-machines/default.nix b/system-profiles/rebuild-machines/default.nix
index e2a15aae..68788023 100644
--- a/system-profiles/rebuild-machines/default.nix
+++ b/system-profiles/rebuild-machines/default.nix
@@ -90,6 +90,13 @@ in {
90 format = "binary"; 90 format = "binary";
91 }; 91 };
92 }; 92 };
93
94 period = mkOption {
95 type = types.nullOr types.str;
96 description = "Call <code>rebuild-${hostName} boot</code> periodically";
97 default = null;
98 example = "hourly";
99 };
93 }; 100 };
94 }; 101 };
95 102
@@ -107,5 +114,27 @@ in {
107 }; 114 };
108 115
109 environment.systemPackages = [ rebuildScript ]; 116 environment.systemPackages = [ rebuildScript ];
117
118 systemd.services."rebuild-${hostName}" = lib.mkIf (cfg.period != null) {
119 description = "Upgrade System on Next Boot";
120 requisite = [ "network.target" ];
121 after = [ "network.target" ];
122
123 restartIfChanged = false;
124 unitConfig.X-StopOnRemoval = false;
125
126 serviceConfig = {
127 Type = "oneshot";
128 ExecStart = "${rebuildScript}/bin/${cfg.scriptName} boot";
129 };
130 };
131
132 systemd.timers."rebuild-${hostName}" = lib.mkIf (cfg.period != null) {
133 wantedBy = [ "timers.target" ];
134 timerConfig = {
135 OnCalendar = cfg.period;
136 Persistent = true;
137 };
138 };
110 }; 139 };
111} 140}