From c56c7910884f449f41323947ce16691a3cdabb96 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 3 Oct 2024 11:35:33 -0500 Subject: [PATCH] pipes pipes --- lib/extended.nix | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/extended.nix b/lib/extended.nix index 862e623..0f91c39 100644 --- a/lib/extended.nix +++ b/lib/extended.nix @@ -47,21 +47,22 @@ let # ["a" "b"] -> {a.enable = true; b.enable = true;} enableAttrs = attrs: - listToAttrs ( - map (attr: { - name = attr; - value = enabled; - }) attrs - ); + attrs + |> map (attr: { + name = attr; + value = enabled; + }) + |> listToAttrs; + # ["a" "b"] -> {a.enable = false; b.enable = false;} disableAttrs = attrs: - listToAttrs ( - map (attr: { - name = attr; - value = disabled; - }) attrs - ); + attrs + |> map (attr: { + name = attr; + value = disabled; + }) + |> listToAttrs; mkIfIn = name: list: prev.mkIf (builtins.elem name list); @@ -110,7 +111,8 @@ let }; loadOverlays = - inputs: dir: readDir dir + inputs: dir: + readDir dir |> attrNames |> filter (f: f != "default.nix") |> map (f: import (../overlays + "/${f}") { inherit inputs; });