Fix impurity

This commit is contained in:
outfoxxed 2023-06-25 22:59:15 -07:00
parent 63665ae641
commit 1693f64ce2
Signed by: outfoxxed
GPG Key ID: 4C88A185FB89301E
1 changed files with 7 additions and 3 deletions

View File

@ -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;