diff options
author | Robert Helgesson <robert@rycee.net> | 2020-01-16 23:41:14 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-01-21 20:47:04 +0100 |
commit | 6e4b9af0803ac00e94398768c5d19d2e423b0be9 (patch) | |
tree | 65f117f6a8b562348eaf12469dadb084af2be417 /modules/lib/stdlib-extended.nix | |
parent | c8323a0bf16acf2c9d89ce164568089017d19668 (diff) |
Switch to extended Nixpkg's `lib`
This change makes use of the `extend` function inside `lib` to inject
a new `hm` field containing the Home Manager library functions. This
simplifies use of the Home Manager library in the modules and reduces
the risk of accidental infinite recursion.
PR #994
Diffstat (limited to 'modules/lib/stdlib-extended.nix')
-rw-r--r-- | modules/lib/stdlib-extended.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/lib/stdlib-extended.nix b/modules/lib/stdlib-extended.nix new file mode 100644 index 00000000000..307f7a07c8f --- /dev/null +++ b/modules/lib/stdlib-extended.nix @@ -0,0 +1,11 @@ +# Just a convenience function that returns the given Nixpkgs standard +# library extended with the HM library. + +nixpkgsLib: + +let + mkHmLib = import ./.; +in + nixpkgsLib.extend (self: super: { + hm = mkHmLib { lib = super; }; + }) |