From 935626ec32ccd9d66656230c1870e39ff76a79e2 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 30 Aug 2020 06:06:59 +0200 Subject: 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. --- machines/profpatsch/haku.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'machines/profpatsch/haku.nix') 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 ).profpatsch.haku.config -- cgit 1.4.1