Strip leading slash from option sources (#348)

This commit is contained in:
Naïm Favier 2021-08-26 09:43:23 +02:00 committed by GitHub
parent e15fddc2b8
commit d4bc4e3a84
Failed to generate hash of commit

View file

@ -75,7 +75,7 @@ let
applyOnAttr = n: f: lib.optionalAttrs (lib.hasAttr n opt) { ${n} = f opt.${n}; };
mkDeclaration = decl:
let
discard = lib.concatStringsSep "/" (lib.take 4 (lib.splitString "/" decl));
discard = lib.concatStringsSep "/" (lib.take 4 (lib.splitString "/" decl)) + "/";
path = if lib.hasPrefix builtins.storeDir decl then lib.removePrefix discard decl else decl;
in
path;