forked from extern/flakelight
Allow escaping nix filenames with +
This allows having a dir for which loadNixDir generates a "default" attr without making the dir importable, by naming the file `+default.nix` instead of `default.nix`.
This commit is contained in:
parent
b2d353f042
commit
426480067c
@ -8,8 +8,8 @@ let
|
||||
inherit (nixpkgs.lib) attrNames attrVals composeManyExtensions filter
|
||||
filterAttrs foldAttrs foldl genAttrs hasSuffix listToAttrs mapAttrs
|
||||
mapAttrsToList mapAttrs' mergeAttrs nameValuePair optional optionalAttrs
|
||||
optionalString parseDrvName pathExists pipe recursiveUpdate removeSuffix
|
||||
zipAttrsWith;
|
||||
optionalString parseDrvName pathExists pipe recursiveUpdate removePrefix
|
||||
removeSuffix zipAttrsWith;
|
||||
|
||||
exports = { inherit mkFlake loadNixDir systems; };
|
||||
|
||||
@ -283,8 +283,10 @@ let
|
||||
attrNames
|
||||
(filter (hasSuffix ".nix"))
|
||||
(map (removeSuffix ".nix"))
|
||||
(map (removePrefix "+"))
|
||||
])
|
||||
(p: import (path + "/${p}.nix"));
|
||||
(p: import (path +
|
||||
(if pathExists (path + "/${p}.nix") then "/${p}.nix" else "/+${p}.nix")));
|
||||
|
||||
systems = rec {
|
||||
linuxDefault = [
|
||||
|
Loading…
Reference in New Issue
Block a user