diff --git a/modules/base/nix/registry.nix b/modules/base/nix/registry.nix index 81578b58..bb9bf468 100644 --- a/modules/base/nix/registry.nix +++ b/modules/base/nix/registry.nix @@ -23,6 +23,6 @@ in nix = { # pin to avoid downloading and evaluating a new inputs everytime registry = mapAttrs (_: flake: { inherit flake; }) flakeInputs; - nixPath = attrValues (mapAttrs (k: v: "${k}=flake:${v.outPath}") flakeInputs); + nixPath = flakeInputs |> mapAttrs (k: v: "${k}=flake:${v.outPath}") |> attrValues; }; } diff --git a/modules/flake/checks/port-collector.nix b/modules/flake/checks/port-collector.nix index e8f2183a..774a9efe 100644 --- a/modules/flake/checks/port-collector.nix +++ b/modules/flake/checks/port-collector.nix @@ -21,9 +21,8 @@ let # "0" is the catch all for services that don't bind a port; we will drop it # before checking for collisions. - collissions = filter (srvList: length srvList > 1) ( - builtins.attrValues (removeAttrs portsToServices [ "0" ]) - ); + collissions = + removeAttrs portsToServices [ "0" ] |> builtins.attrValues |> filter (srvList: length srvList > 1); in runCommandLocal "port-collector" { diff --git a/modules/home/environment/xdg.nix b/modules/home/environment/xdg.nix index 80e2b69e..6fe56911 100644 --- a/modules/home/environment/xdg.nix +++ b/modules/home/environment/xdg.nix @@ -6,6 +6,7 @@ ... }: let + inherit (lib.attrsets) nameValuePair listToAttrs; inherit (lib.modules) mkForce; inherit (pkgs.stdenv.hostPlatform) isLinux; @@ -68,9 +69,11 @@ let }; }; - associations' = lib.concatMapAttrs ( - _: val: lib.listToAttrs (lib.map (mt: lib.nameValuePair mt "${val.app}.desktop") val.mimeTypes) - ) appsToAssoc; + associations' = + appsToAssoc + |> lib.concatMapAttrs ( + _: val: val.mimeTypes |> map (mt: nameValuePair mt "${val.app}.desktop") |> listToAttrs + ); specifics = { "x-scheme-handler/spotify" = [ "spotify.desktop" ]; diff --git a/modules/nixos/emulation.nix b/modules/nixos/emulation.nix index 09cf20c0..dd40126c 100644 --- a/modules/nixos/emulation.nix +++ b/modules/nixos/emulation.nix @@ -6,21 +6,17 @@ }: let inherit (lib.attrsets) genAttrs; - inherit (lib.lists) elemAt; + inherit (lib.lists) head; inherit (lib.modules) mkIf; inherit (lib.options) mkOption mkEnableOption; inherit (lib.strings) splitString; - inherit (lib.trivial) flip pipe; inherit (lib) filter; inherit (lib.types) listOf str ; - getArch = flip pipe [ - (splitString "-") - (flip elemAt 0) - ]; + getArch = system: splitString "-" system |> head; cfg = config.garden.system.emulation; in