summaryrefslogtreecommitdiffstats
path: root/lass/2configs/rebuild-on-boot.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-01-05 20:59:29 +0100
committerlassulus <lassulus@lassul.us>2018-01-05 20:59:29 +0100
commit21bd13b2de964b178e5d42b69efc337e09698dd2 (patch)
tree7cc127e5b22774ab28697cac160450dbc92099f3 /lass/2configs/rebuild-on-boot.nix
parente083b18e34519f30bba79dfd894c3b828fd13da7 (diff)
l: container hackery
Diffstat (limited to 'lass/2configs/rebuild-on-boot.nix')
-rw-r--r--lass/2configs/rebuild-on-boot.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/lass/2configs/rebuild-on-boot.nix b/lass/2configs/rebuild-on-boot.nix
new file mode 100644
index 000000000..60198be7b
--- /dev/null
+++ b/lass/2configs/rebuild-on-boot.nix
@@ -0,0 +1,18 @@
+{ config, pkgs, ... }:
+with import <stockholm/lib>;
+{
+ systemd.services.rebuild-on-boot = {
+ wantedBy = [ "multi-user.target" ];
+ environment = {
+ NIX_REMOTE = "daemon";
+ HOME = "/var/empty";
+ };
+ serviceConfig = {
+ ExecStart = pkgs.writeScript "rebuild" ''
+ #!${pkgs.bash}/bin/bash
+ (/run/current-system/sw/bin/nixos-rebuild -I /var/src switch) &
+ '';
+ ExecStop = "${pkgs.coreutils}/bin/sleep 10";
+ };
+ };
+}