From 451c79270d3b89db669414d6581885692eb22e41 Mon Sep 17 00:00:00 2001 From: Chris Dombroski Date: Sun, 17 Nov 2024 18:26:23 -0500 Subject: [PATCH] pipes --- home-modules/default.nix | 13 ++++++------- nixos-modules/common.nix | 11 ++++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/home-modules/default.nix b/home-modules/default.nix index b52b326..9b8c486 100644 --- a/home-modules/default.nix +++ b/home-modules/default.nix @@ -1,12 +1,11 @@ { lib, ... }: { - imports = builtins.map (n: ./${n}) ( - builtins.attrNames ( - lib.filterAttrs (k: v: v == "regular" && lib.hasSuffix ".nix" k && k != "default.nix") ( - builtins.readDir ./. - ) - ) - ); + imports = lib.pipe ./. [ + builtins.readDir + (lib.filterAttrs (k: v: v == "regular" && lib.hasSuffix ".nix" k && k != "default.nix")) + builtins.attrNames + (builtins.map (n: ./${n})) + ]; programs.home-manager.enable = true; } diff --git a/nixos-modules/common.nix b/nixos-modules/common.nix index daf4479..b5f2c24 100644 --- a/nixos-modules/common.nix +++ b/nixos-modules/common.nix @@ -1,8 +1,9 @@ { lib, ... }: { - imports = builtins.map (n: ./common/${n}) ( - builtins.attrNames ( - lib.filterAttrs (k: v: v == "regular" && lib.hasSuffix ".nix" k) (builtins.readDir ./common) - ) - ); + imports = lib.pipe ./common [ + builtins.readDir + (lib.filterAttrs (k: v: v == "regular" && lib.hasSuffix ".nix" k)) + builtins.attrNames + (builtins.map (n: ./common/${n})) + ]; }