summaryrefslogtreecommitdiffstats
path: root/lass/2configs/rebuild-on-boot.nix
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-01-06 21:36:32 +0100
committerjeschli <jeschli@gmail.com>2018-01-06 21:36:32 +0100
commit1967d8b04f2a8e9755818ef141eb1d3ea08e8ae7 (patch)
tree295b8ffebed0a07d291c68477f939a50a9e6212d /lass/2configs/rebuild-on-boot.nix
parent183b001e1aca601e420ef07ec4944a15c13a8d2c (diff)
parentacecab429219d9086e23fa8912ecb05c017211d1 (diff)
Merge branch 'master' of prism.r:stockholm
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";
+ };
+ };
+}