summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pure.nix22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/pure.nix b/lib/pure.nix
index 4178fcf7..0d807404 100644
--- a/lib/pure.nix
+++ b/lib/pure.nix
@@ -1,8 +1,28 @@
-{ lib, ... }:
+{ lib
+, localHomeDirectory ? /var/empty
+, ...
+}:
let
nixpkgs-lib = lib;
stockholm.lib = with stockholm.lib; nixpkgs-lib // builtins // {
+ debug = s: builtins.trace ("" + s + "") true;
+
+ debugIf = c: s: if c then debug s else true;
+
+ pretty = x:
+ if lib.isPath x then
+ if lib.hasPrefix (toString localHomeDirectory) (toString x) then
+ "~" + lib.removePrefix (toString localHomeDirectory) (toString x)
+ else if lib.hasPrefix (toString ./..) (toString x) then
+ "~/sync/src/hrm" + lib.removePrefix (toString ./..) (toString x)
+ else
+ toString x
+ else if lib.isDerivation x then
+ x.name
+ else
+ toString x;
+
evalModulesConfig = modules: let
eval = evalModules {
inherit modules;