1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

lib: improve DAG library

Specifically,

- directly export `modules/lib/dag.nix` instead of renaming
  attributes,

- run through utilities to reuse code where possible,

- expose `lib.hm.dag.isEntry` and reuse it in
  `modules/lib/types-dag.nix`,

- reuse utilities through `lib` set instead of passing imports to
  functions, and

- eta reduction of `map`, `entryAnywhere`, `entryAfter` and
  `entryBefore`.
This commit is contained in:
rcerc 2022-01-13 12:21:32 -05:00 committed by Robert Helgesson
parent 30dda628bc
commit 4a724cb84c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 50 additions and 79 deletions

View file

@ -1,5 +1,4 @@
{ lib, dag ? import ./dag.nix { inherit lib; }
, gvariant ? import ./gvariant.nix { inherit lib; } }:
{ lib, gvariant ? import ./gvariant.nix { inherit lib; } }:
let
inherit (lib)
@ -7,7 +6,7 @@ let
mergeAttrs mergeDefaultOption mergeOneOption mergeOptions mkOption
mkOptionType showFiles showOption types;
typesDag = import ./types-dag.nix { inherit dag lib; };
typesDag = import ./types-dag.nix { inherit lib; };
# Needed since the type is called gvariant and its merge attribute
# must refer back to the type.