diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 177e1be..8c14ea4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,7 @@ jobs: extra_nix_config: | trusted-public-keys = youthlic.cachix.org-1:zkUZ/ZGGF5fZxvg5WO3K8XAsUAPFmQKWbnAFb3W5x+Y= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= substituters = https://youthlic.cachix.org/ https://niri.cachix.org/ https://nix-community.cachix.org/ https://chaotic-nyx.cachix.org/ https://cache.nixos.org/ + experimental-features = nix-command flakes pipe-operator - uses: cachix/cachix-action@v14 with: name: youthlic diff --git a/flake/deploy.nix b/flake/deploy.nix index cc91f14..8ebe2b4 100644 --- a/flake/deploy.nix +++ b/flake/deploy.nix @@ -39,20 +39,16 @@ in }; config = { flake.deploy.nodes = - with lib; - pipe - [ - "Cape" - "Akun" - ] - [ - (map ( - hostName: - mkDeployNode { - inherit hostName; - } - )) - (foldr (a: b: a // b) { }) - ]; + [ + "Cape" + "Akun" + ] + |> map ( + hostName: + mkDeployNode { + inherit hostName; + } + ) + |> lib.foldr (a: b: a // b) { }; }; } diff --git a/flake/home.nix b/flake/home.nix index 88e403b..639acb5 100644 --- a/flake/home.nix +++ b/flake/home.nix @@ -9,20 +9,18 @@ let inherit (self) outputs; homeModules = ( - with lib; - pipe (rootPath + "/home") [ - builtins.readDir - (filterAttrs (_key: value: value == "directory")) - (filterAttrs ( - key: _value: - !builtins.elem key [ - "modules" - "extra" - ] - )) - builtins.attrNames - (flip genAttrs (name: import (rootPath + "/home/${name}/modules"))) - ] + (rootPath + "/home") + |> builtins.readDir + |> lib.filterAttrs (_key: value: value == "directory") + |> lib.filterAttrs ( + key: _value: + !builtins.elem key [ + "modules" + "extra" + ] + ) + |> builtins.attrNames + |> (with lib; flip genAttrs (name: import (rootPath + "/home/${name}/modules"))) ) // { default = import "${toString rootPath}/home/modules"; @@ -71,15 +69,12 @@ let in { flake = { - homeConfigurations = - with lib; - foldr (a: b: a // b) { } ( - pipe - [ - # Hostname - ] - [ (map (hostName: makeHomeConfiguration { inherit hostName; })) ] - ); + homeConfigurations = lib.foldr (a: b: a // b) { } ( + [ + # Hostname + ] + |> map (hostName: makeHomeConfiguration { inherit hostName; }) + ); inherit homeModules; }; } diff --git a/flake/nixos.nix b/flake/nixos.nix index 5dc4fc1..aad7864 100644 --- a/flake/nixos.nix +++ b/flake/nixos.nix @@ -30,13 +30,11 @@ in }; }; in - with lib; - pipe - [ - "Tytonidae" - "Cape" - "Akun" - ] - [ (flip genAttrs makeNixosConfiguration) ]; + [ + "Tytonidae" + "Cape" + "Akun" + ] + |> (with lib; flip genAttrs makeNixosConfiguration); }; } diff --git a/flake/overlays.nix b/flake/overlays.nix index 95d165b..eb44391 100644 --- a/flake/overlays.nix +++ b/flake/overlays.nix @@ -11,11 +11,9 @@ let in { flake.overlays = - with lib; - pipe - [ - "modifications" - "additions" - ] - [ (flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))) ]; + [ + "modifications" + "additions" + ] + |> (with lib; flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))); } diff --git a/home/david/modules/programs/alacritty/default.nix b/home/david/modules/programs/alacritty/default.nix index 37df2d4..69551d6 100644 --- a/home/david/modules/programs/alacritty/default.nix +++ b/home/david/modules/programs/alacritty/default.nix @@ -17,22 +17,14 @@ in programs.alacritty = { enable = true; package = pkgs.alacritty_git; - settings = - ( - with lib; - pipe ./alacritty.toml [ - builtins.readFile - builtins.fromTOML - ] - ) - // { - colors = lib.mkForce { }; - font.size = lib.mkForce 16; - window.opacity = lib.mkForce 0.8; - general.import = [ - "${pkgs.alacritty-theme}/share/alacritty-theme/gruvbox_dark.toml" - ]; - }; + settings = (./alacritty.toml |> builtins.readFile |> builtins.fromTOML) // { + colors = lib.mkForce { }; + font.size = lib.mkForce 16; + window.opacity = lib.mkForce 0.8; + general.import = [ + "${pkgs.alacritty-theme}/share/alacritty-theme/gruvbox_dark.toml" + ]; + }; }; }; } diff --git a/home/modules/programs/helix/default.nix b/home/modules/programs/helix/default.nix index 64bb758..717d76b 100644 --- a/home/modules/programs/helix/default.nix +++ b/home/modules/programs/helix/default.nix @@ -56,12 +56,7 @@ in enable = true; defaultEditor = true; extraPackages = cfg.extraPackages; - settings = - with lib; - pipe ./config.toml [ - builtins.readFile - builtins.fromTOML - ]; + settings = ./config.toml |> builtins.readFile |> builtins.fromTOML; languages = lib.recursiveUpdate { language-server = { neocmakelsp = { diff --git a/nixos/modules/nix.nix b/nixos/modules/nix.nix index cae67e7..cbae8ed 100644 --- a/nixos/modules/nix.nix +++ b/nixos/modules/nix.nix @@ -9,15 +9,13 @@ { config = { environment.etc = - with lib; - pipe inputs [ - (mapAttrs' ( - name: value: - lib.nameValuePair "nix/inputs/${name}" { - source = value; - } - )) - ]; + inputs + |> lib.mapAttrs' ( + name: value: + lib.nameValuePair "nix/inputs/${name}" { + source = value; + } + ); nixpkgs = { config = { allowUnfree = true; @@ -74,7 +72,9 @@ experimental-features = [ "nix-command" "flakes" - ]; + ] + ++ (lib.optional config.lix.enable "pipe-operator") + ++ (lib.optional (!config.lix.enable) "pipe-operators"); warn-dirty = false; system-features = [ "kvm" @@ -85,17 +85,15 @@ }; package = pkgs.nix; registry = - with lib; - pipe inputs [ - (filterAttrs (name: _value: name != "nixpkgs")) - (mapAttrs ( - _name: value: { - flake = lib.mkForce { - outPath = value; - }; - } - )) - ]; + inputs + |> lib.filterAttrs (name: _value: name != "nixpkgs") + |> lib.mapAttrs ( + _name: value: { + flake = lib.mkForce { + outPath = value; + }; + } + ); }; }; } diff --git a/overlays/additions/default.nix b/overlays/additions/default.nix index 44b55b5..a73aec7 100644 --- a/overlays/additions/default.nix +++ b/overlays/additions/default.nix @@ -3,22 +3,18 @@ final: prev: let inherit (prev) lib; in -with lib; -pipe - [ - ./TrackersListCollection.nix - ./OuterWildsTextAdventure.nix - ./editor-runtime.nix - ./wallpapers.nix - ./rime-yuhaostar.nix - ./rime-all.nix - ./nixvim.nix - ./doom-emacs.nix - ./osu-lazer-bin.nix # typochecker: disable-line +[ + ./TrackersListCollection.nix + ./OuterWildsTextAdventure.nix + ./editor-runtime.nix + ./wallpapers.nix + ./rime-yuhaostar.nix + ./rime-all.nix + ./nixvim.nix + ./doom-emacs.nix + ./osu-lazer-bin.nix # typochecker: disable-line - ./pkgsNoCuda.nix - ] - [ - (map (file: import file args)) - (overlays: (lib.composeManyExtensions overlays) final prev) - ] + ./pkgsNoCuda.nix +] +|> map (file: import file args) +|> (overlays: (lib.composeManyExtensions overlays) final prev) diff --git a/overlays/modifications/default.nix b/overlays/modifications/default.nix index e6bcfee..0069ba5 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -3,26 +3,22 @@ final: prev: let inherit (prev) lib; in -with lib; -pipe - [ - ./niri.nix - ./spotifyx.nix - ./radicle-explorer.nix - ./wshowkeys.nix - # ./QQ.nix - ./helix.nix - ./cliphist.nix - ./zulip.nix - ./spotifyd.nix - ./nautilus.nix - ./neovim-nightly.nix - ./vim.nix +[ + ./niri.nix + ./spotifyx.nix + ./radicle-explorer.nix + ./wshowkeys.nix + # ./QQ.nix + ./helix.nix + ./cliphist.nix + ./zulip.nix + ./spotifyd.nix + ./nautilus.nix + ./neovim-nightly.nix + ./vim.nix - # Nur - ./nur.nix - ] - [ - (map (file: import file args)) - (overlays: (lib.composeManyExtensions overlays) final prev) - ] + # Nur + ./nur.nix +] +|> map (file: import file args) +|> (overlays: (lib.composeManyExtensions overlays) final prev) diff --git a/pkgs/helix/runtime.nix b/pkgs/helix/runtime.nix index 65117ee..d7c5683 100644 --- a/pkgs/helix/runtime.nix +++ b/pkgs/helix/runtime.nix @@ -60,30 +60,26 @@ let runHook postFixup ''; }; - grammars = with lib; pipe srcs [ (filterAttrs (key: _: hasPrefix "tree-sitter-" key)) ]; + grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key); queries = - with lib; - pipe grammars [ - (mapAttrsToList ( - _: value: '' - mkdir -p $out/${value.name} + grammars + |> lib.mapAttrsToList ( + _: value: '' + mkdir -p $out/${value.name} - ln -s ${value.src}/queries/* $out/${value.name}/ - '' - )) - ]; + ln -s ${value.src}/queries/* $out/${value.name}/ + '' + ); grammarLinks = - with lib; - pipe grammars [ - (builtins.mapAttrs ( - _: v: { - inherit (v) name; - value = buildGrammar v; - } - )) - (mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so")) - ]; + grammars + |> builtins.mapAttrs ( + _: v: { + inherit (v) name; + value = buildGrammar v; + } + ) + |> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"); grammarDir = runCommandLocal "helix-grammars" { } '' mkdir -p $out diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix index e759e92..837ac5f 100644 --- a/pkgs/wallpapers.nix +++ b/pkgs/wallpapers.nix @@ -7,10 +7,9 @@ let wallpapers = with lib; - pipe srcs [ - (filterAttrs (name: _value: hasPrefix "wallpaper" name)) - (concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}")) - ]; + srcs + |> filterAttrs (name: _value: hasPrefix "wallpaper" name) + |> concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}"); in runCommandLocal "wallpapers" { } '' mkdir -p $out diff --git a/treefmt.nix b/treefmt.nix index a81d136..cb2cca0 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -1,6 +1,6 @@ { perSystem = - { pkgs, lib, ... }: + { pkgs, ... }: { treefmt = { programs = { @@ -41,12 +41,7 @@ }; typos = let - config = - with lib; - pipe ./.typos.toml [ - builtins.readFile - builtins.fromTOML - ]; + config = ./.typos.toml |> builtins.readFile |> builtins.fromTOML; in { enable = true;