about summary refs log tree commit diff
path: root/machines/profpatsch/haku.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-08-30 06:06:59 +0200
committerProfpatsch <mail@profpatsch.de>2020-08-30 06:06:59 +0200
commit935626ec32ccd9d66656230c1870e39ff76a79e2 (patch)
tree9aa0ae9037f78d196d36186e77ae7c7696c02848 /machines/profpatsch/haku.nix
parent654d754183b0477ec7d40a3216948590b35f7222 (diff)
machines/haku: set NIX_PATH to filtered pkgs.path
This is a step towards a saner deployment for these machines.
The NIX_PATH is fixed, so that everything on the running system always
uses exactly the nixpkgs version the system was deployed with.
The deployment is done by copying the system closure and switching to
it via the `bin/switch-to-configuration` script.

Uses the reference to pkgs.path, and applies filterSourceGitignore on
the directory, since I often deploy from a local checkout which is
half a GB without the gitignore filter.
Diffstat (limited to 'machines/profpatsch/haku.nix')
-rw-r--r--machines/profpatsch/haku.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/machines/profpatsch/haku.nix b/machines/profpatsch/haku.nix
index 44035311..39c617a7 100644
--- a/machines/profpatsch/haku.nix
+++ b/machines/profpatsch/haku.nix
@@ -38,8 +38,19 @@ in
     nix.maxJobs = 2;
     vuizvui.modifyNixPath = false;
     nix.nixPath = [
-      "vuizvui=/root/vuizvui"
-      "nixpkgs=/root/nixpkgs"
+      "nixpkgs=${with pkgs.vuizvui.profpatsch; filterSourceGitignoreWith {
+          gitignoreLines =
+            readGitignoreFile "${toString pkgs.path}/.gitignore";
+          globMap = glob:
+            # filter out the non-rooted file globs,
+            # because those take forever to filter
+            # (10(!) seconds evaluation time in my test).
+            if (!glob.isDir && !glob.isRooted)
+            then null
+            else glob;
+        } pkgs.path}"
+      # TODO?
+      # "vuizvui=/root/vuizvui"
       # TODO: nicer?
       "nixos-config=${pkgs.writeText "haku-configuration.nix" ''
         (import <vuizvui/machines>).profpatsch.haku.config