fix(nix): remove flattenAttrs
unfortunately modules don't like to be merged
This commit is contained in:
parent
9abcb6c85b
commit
1dc3f4bf44
3 changed files with 4 additions and 33 deletions
|
@ -1,36 +1,10 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
cfg = config.flake;
|
||||
inherit (lib.attrsets) mapAttrs concatMapAttrs;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
in
|
||||
{
|
||||
flake.lib = {
|
||||
/**
|
||||
Remove the top level attributes from an attribute set and return the merged attributes.
|
||||
|
||||
# Inputs
|
||||
|
||||
`attrset`
|
||||
|
||||
: An attribute set to flatten.
|
||||
|
||||
# Type
|
||||
|
||||
```
|
||||
flattenAttrs :: AttrSet -> AttrSet
|
||||
```
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `flattenAttrs` usage example
|
||||
|
||||
```nix
|
||||
flattenAttrs { x = { a = 1; b = 2; }; y = { c = 3; d = 4; }; }
|
||||
=> { a = 1; b = 2; c = 3; d = 4; }
|
||||
```
|
||||
*/
|
||||
flattenAttrs = attrset: concatMapAttrs (_: v: v) attrset;
|
||||
|
||||
/**
|
||||
Return an attribute set for use with a option that needs to be used for all users.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue