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:
parent
5973a46a75
commit
8e1f14e82d
4 changed files with 9 additions and 6 deletions
|
@ -58,8 +58,8 @@ Returns:
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
hello = «derivation»;
|
hello = «derivation»;
|
||||||
gitAndTools_git = «derivation»;
|
"gitAndTools/git" = «derivation»;
|
||||||
gitAndTools_hub = «derivation»;
|
"gitAndTools/hub" = «derivation»;
|
||||||
# ...
|
# ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -52,8 +52,8 @@ let
|
||||||
#
|
#
|
||||||
# {
|
# {
|
||||||
# hello = «derivation»;
|
# hello = «derivation»;
|
||||||
# gitAndTools_git = «derivation»;
|
# "gitAndTools/git" = «derivation»;
|
||||||
# gitAndTools_hub = «derivation»;
|
# "gitAndTools/hub" = «derivation»;
|
||||||
# # ...
|
# # ...
|
||||||
# }
|
# }
|
||||||
flattenTree = tree: import ./flattenTree.nix tree;
|
flattenTree = tree: import ./flattenTree.nix tree;
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
rec {
|
rec {
|
||||||
packages.hello = pkgs.hello;
|
packages = flake-utils.lib.flattenTree {
|
||||||
|
hello = pkgs.hello;
|
||||||
|
gitAndTools = pkgs.gitAndTools;
|
||||||
|
};
|
||||||
defaultPackage = packages.hello;
|
defaultPackage = packages.hello;
|
||||||
apps.hello = flake-utils.lib.mkApp { drv = packages.hello; };
|
apps.hello = flake-utils.lib.mkApp { drv = packages.hello; };
|
||||||
defaultApp = apps.hello;
|
defaultApp = apps.hello;
|
||||||
|
|
|
@ -2,7 +2,7 @@ tree:
|
||||||
let
|
let
|
||||||
op = sum: path: val:
|
op = sum: path: val:
|
||||||
let
|
let
|
||||||
pathStr = builtins.concatStringsSep "_" path;
|
pathStr = builtins.concatStringsSep "/" path;
|
||||||
in
|
in
|
||||||
if (builtins.typeOf val) != "set" then
|
if (builtins.typeOf val) != "set" then
|
||||||
# ignore that value
|
# ignore that value
|
||||||
|
|
Loading…
Reference in a new issue