nur @main -
refs -
log -
-
https://git.jolheiser.com/nur.git
Refactor `overlay.nix`
Simplify `overlay.nix` a bit by removing unnecessary filtering on
attribute values.
Signature
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEsSF1dKCmBcF0zekSNr2qFMJ5fokFAlydUEYACgkQNr2qFMJ5
foms2A//Z8rsBq7zt6YB1rD9QkDrGCIAxiUYtChraW7EFrXbdKeGrpy/wIdITlO6
8bWp5yiATJWGeIE6DLh+MWJiJeOwCpYYStmNrNlIjEFaXl5EGS+emekfQsv+HkRk
mEzEqax7Xz9dws2cqO1MgXnm6ccJ1gr6UP51/gK3RGogpXxADWt5SjFR8teDvSGe
YxTUNOqXvWIqhVHjgTu77nN2sYjhMGJomc8NE1xrOqi1uf5CNG+BoYnbBn0Q3cw+
NX661LW3T8FO5N2nY7tA0CHRs0ksVCqS3q741O9sY/dYBZhGY3N7xe4xgsugaiMY
BaA4ZUQ0YNk2C6Dq284XZrt5Q2OHXHJafE9kDDWjmdMaUC3mqR6HNBfiCboKtvjt
IgfyeuYMN0HxEbmpkcbiCNcW5x+iydSZlf+yfZr+l7qpru4d1w2VHlyH3+oZyM05
AysvhkiXcDU0HbHuasDT996Uof9hxBdieHAY5SNMHz9hhnxvlLGmONExUsCO4YoD
hbCvDpYavu0tNKBHFAcw66KWF1Z8zpZTOx0MtUoyGKD/BSuZ5ZtrkUwk1Eg9WcQf
sdZRDgOSzcNKTbs4iCSPr76Ri4a3AZXN4fUY3fbJEG6YkM8knFylrVpCEGVooCXg
rg37h/tYHsNKhjXnIdGvq/Hcmfx0R0E6DmvJ5TmCVO7+MDugSJ0=
=mdMm
-----END PGP SIGNATURE-----
diff --git a/overlay.nix b/overlay.nix
index bda4332a081fcd8c713733a27a02f0dc312cd32c..122729de0fdc9ac97ec903c039bb438d92958ad6 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -1,23 +1,18 @@
-# You can use this file as a nixpkgs overlay.
-# It's useful in the case where you don't want to add the whole NUR namespace
-# to your configuration.
+# You can use this file as a nixpkgs overlay. This is useful in the
+# case where you don't want to add the whole NUR namespace to your
+# configuration.
self: super:
let
- filterSet =
- (f: g: s: builtins.listToAttrs
- (map
- (n: { name = n; value = builtins.getAttr n s; })
- (builtins.filter
- (n: f n && g (builtins.getAttr n s))
- (builtins.attrNames s)
- )
- )
- );
- isReserved = n: builtins.elem n ["lib" "overlays" "modules"];
-in filterSet
- (n: !(isReserved n)) # filter out non-packages
- (p: true) # all packages are ok
- (import ./default.nix { pkgs = super; })
+
+ isReserved = n: n == "lib" || n == "overlays" || n == "modules";
+ nameValuePair = n: v: { name = n; value = v; };
+ nurAttrs = import ./default.nix { pkgs = super; };
+
+in
+ builtins.listToAttrs
+ (map (n: nameValuePair n nurAttrs.${n})
+ (builtins.filter (n: !isReserved n)
+ (builtins.attrNames nurAttrs)))