diff --git a/modules/impurity.nix b/modules/impurity.nix index b6cc507..14356d3 100644 --- a/modules/impurity.nix +++ b/modules/impurity.nix @@ -1,6 +1,6 @@ self: { lib, config, pkgs, ... }: with lib; let relativePath = path: assert types.path.check path; - with builtins; strings.removePrefix ("${toString self}") (toString path); + with builtins; strings.removePrefix (toString self) (toString path); impurityGroupEnabled = group: let impurityGroups = strings.splitString " " (builtins.getEnv "IMPURITY_GROUPS"); @@ -10,9 +10,13 @@ self: { lib, config, pkgs, ... }: with lib; let impurePathEnv = builtins.getEnv "IMPURITY_PATH"; in if impurePathEnv == "" then throw "impurity.enable is true but IMPURITY_PATH is not set" - else /. + impurePathEnv; + else impurePathEnv; + + createImpurePath = path: let + relative = (relativePath path); + full = impurePath + relative; + in pkgs.runCommand "impurity-${relative}" {} "ln -s ${full} $out"; - createImpurePath = path: impurePath + (relativePath path); in { options.impurity.enable = mkOption { type = types.bool;