1
0
Fork 0
mirror of https://github.com/numtide/flake-utils.git synced 2024-12-14 11:47:31 +00:00

flattenTree: use / as the key separator

That character is less likely to be used in normal packaging names.
This commit is contained in:
zimbatm 2020-07-22 11:35:14 +02:00
parent 5973a46a75
commit 8e1f14e82d
No known key found for this signature in database
GPG key ID: 71BAF6D40C1D63D7
4 changed files with 9 additions and 6 deletions

View file

@ -58,8 +58,8 @@ Returns:
```nix
{
hello = «derivation»;
gitAndTools_git = «derivation»;
gitAndTools_hub = «derivation»;
"gitAndTools/git" = «derivation»;
"gitAndTools/hub" = «derivation»;
# ...
}
```

View file

@ -52,8 +52,8 @@ let
#
# {
# hello = «derivation»;
# gitAndTools_git = «derivation»;
# gitAndTools_hub = «derivation»;
# "gitAndTools/git" = «derivation»;
# "gitAndTools/hub" = «derivation»;
# # ...
# }
flattenTree = tree: import ./flattenTree.nix tree;

View file

@ -7,7 +7,10 @@
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
rec {
packages.hello = pkgs.hello;
packages = flake-utils.lib.flattenTree {
hello = pkgs.hello;
gitAndTools = pkgs.gitAndTools;
};
defaultPackage = packages.hello;
apps.hello = flake-utils.lib.mkApp { drv = packages.hello; };
defaultApp = apps.hello;

View file

@ -2,7 +2,7 @@ tree:
let
op = sum: path: val:
let
pathStr = builtins.concatStringsSep "_" path;
pathStr = builtins.concatStringsSep "/" path;
in
if (builtins.typeOf val) != "set" then
# ignore that value