From 6a7b5838bc28801ca28019e493e2a48319acc13a Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Fri, 7 Nov 2025 23:54:49 +0800 Subject: [PATCH] fix: Remove `|>` operator to fix ci --- .github/workflows/test.yml | 1 - flake/deploy.nix | 26 +++++++----- flake/home.nix | 41 +++++++++++-------- flake/nixos.nix | 14 ++++--- flake/overlays.nix | 12 +++--- .../modules/programs/alacritty/default.nix | 24 +++++++---- home/modules/programs/helix/default.nix | 7 +++- nixos/modules/nix.nix | 40 +++++++++--------- overlays/additions/default.nix | 32 ++++++++------- overlays/modifications/default.nix | 40 ++++++++++-------- pkgs/helix/runtime.nix | 36 ++++++++-------- pkgs/wallpapers.nix | 7 ++-- treefmt.nix | 9 +++- 13 files changed, 167 insertions(+), 122 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c14ea4..177e1be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,6 @@ 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 8ebe2b4..cc91f14 100644 --- a/flake/deploy.nix +++ b/flake/deploy.nix @@ -39,16 +39,20 @@ in }; config = { flake.deploy.nodes = - [ - "Cape" - "Akun" - ] - |> map ( - hostName: - mkDeployNode { - inherit hostName; - } - ) - |> lib.foldr (a: b: a // b) { }; + with lib; + pipe + [ + "Cape" + "Akun" + ] + [ + (map ( + hostName: + mkDeployNode { + inherit hostName; + } + )) + (foldr (a: b: a // b) { }) + ]; }; } diff --git a/flake/home.nix b/flake/home.nix index 639acb5..88e403b 100644 --- a/flake/home.nix +++ b/flake/home.nix @@ -9,18 +9,20 @@ let inherit (self) outputs; homeModules = ( - (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"))) + 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"))) + ] ) // { default = import "${toString rootPath}/home/modules"; @@ -69,12 +71,15 @@ let in { flake = { - homeConfigurations = lib.foldr (a: b: a // b) { } ( - [ - # Hostname - ] - |> map (hostName: makeHomeConfiguration { inherit hostName; }) - ); + homeConfigurations = + with lib; + foldr (a: b: a // b) { } ( + pipe + [ + # Hostname + ] + [ (map (hostName: makeHomeConfiguration { inherit hostName; })) ] + ); inherit homeModules; }; } diff --git a/flake/nixos.nix b/flake/nixos.nix index aad7864..5dc4fc1 100644 --- a/flake/nixos.nix +++ b/flake/nixos.nix @@ -30,11 +30,13 @@ in }; }; in - [ - "Tytonidae" - "Cape" - "Akun" - ] - |> (with lib; flip genAttrs makeNixosConfiguration); + with lib; + pipe + [ + "Tytonidae" + "Cape" + "Akun" + ] + [ (flip genAttrs makeNixosConfiguration) ]; }; } diff --git a/flake/overlays.nix b/flake/overlays.nix index eb44391..95d165b 100644 --- a/flake/overlays.nix +++ b/flake/overlays.nix @@ -11,9 +11,11 @@ let in { flake.overlays = - [ - "modifications" - "additions" - ] - |> (with lib; flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))); + with lib; + pipe + [ + "modifications" + "additions" + ] + [ (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 69551d6..37df2d4 100644 --- a/home/david/modules/programs/alacritty/default.nix +++ b/home/david/modules/programs/alacritty/default.nix @@ -17,14 +17,22 @@ in programs.alacritty = { enable = true; package = pkgs.alacritty_git; - 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" - ]; - }; + 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" + ]; + }; }; }; } diff --git a/home/modules/programs/helix/default.nix b/home/modules/programs/helix/default.nix index 717d76b..64bb758 100644 --- a/home/modules/programs/helix/default.nix +++ b/home/modules/programs/helix/default.nix @@ -56,7 +56,12 @@ in enable = true; defaultEditor = true; extraPackages = cfg.extraPackages; - settings = ./config.toml |> builtins.readFile |> builtins.fromTOML; + settings = + with lib; + pipe ./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 cbae8ed..cae67e7 100644 --- a/nixos/modules/nix.nix +++ b/nixos/modules/nix.nix @@ -9,13 +9,15 @@ { config = { environment.etc = - inputs - |> lib.mapAttrs' ( - name: value: - lib.nameValuePair "nix/inputs/${name}" { - source = value; - } - ); + with lib; + pipe inputs [ + (mapAttrs' ( + name: value: + lib.nameValuePair "nix/inputs/${name}" { + source = value; + } + )) + ]; nixpkgs = { config = { allowUnfree = true; @@ -72,9 +74,7 @@ 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,15 +85,17 @@ }; package = pkgs.nix; registry = - inputs - |> lib.filterAttrs (name: _value: name != "nixpkgs") - |> lib.mapAttrs ( - _name: value: { - flake = lib.mkForce { - outPath = value; - }; - } - ); + with lib; + pipe inputs [ + (filterAttrs (name: _value: name != "nixpkgs")) + (mapAttrs ( + _name: value: { + flake = lib.mkForce { + outPath = value; + }; + } + )) + ]; }; }; } diff --git a/overlays/additions/default.nix b/overlays/additions/default.nix index a73aec7..44b55b5 100644 --- a/overlays/additions/default.nix +++ b/overlays/additions/default.nix @@ -3,18 +3,22 @@ final: prev: let inherit (prev) lib; in -[ - ./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 +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 - ./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 0069ba5..e6bcfee 100644 --- a/overlays/modifications/default.nix +++ b/overlays/modifications/default.nix @@ -3,22 +3,26 @@ final: prev: let inherit (prev) lib; in -[ - ./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 +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 - # 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 d7c5683..65117ee 100644 --- a/pkgs/helix/runtime.nix +++ b/pkgs/helix/runtime.nix @@ -60,26 +60,30 @@ let runHook postFixup ''; }; - grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key); + grammars = with lib; pipe srcs [ (filterAttrs (key: _: hasPrefix "tree-sitter-" key)) ]; queries = - grammars - |> lib.mapAttrsToList ( - _: value: '' - mkdir -p $out/${value.name} + with lib; + pipe grammars [ + (mapAttrsToList ( + _: value: '' + mkdir -p $out/${value.name} - ln -s ${value.src}/queries/* $out/${value.name}/ - '' - ); + ln -s ${value.src}/queries/* $out/${value.name}/ + '' + )) + ]; grammarLinks = - grammars - |> builtins.mapAttrs ( - _: v: { - inherit (v) name; - value = buildGrammar v; - } - ) - |> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"); + 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")) + ]; grammarDir = runCommandLocal "helix-grammars" { } '' mkdir -p $out diff --git a/pkgs/wallpapers.nix b/pkgs/wallpapers.nix index 837ac5f..e759e92 100644 --- a/pkgs/wallpapers.nix +++ b/pkgs/wallpapers.nix @@ -7,9 +7,10 @@ let wallpapers = with lib; - srcs - |> filterAttrs (name: _value: hasPrefix "wallpaper" name) - |> concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}"); + pipe 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 cb2cca0..a81d136 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -1,6 +1,6 @@ { perSystem = - { pkgs, ... }: + { pkgs, lib, ... }: { treefmt = { programs = { @@ -41,7 +41,12 @@ }; typos = let - config = ./.typos.toml |> builtins.readFile |> builtins.fromTOML; + config = + with lib; + pipe ./.typos.toml [ + builtins.readFile + builtins.fromTOML + ]; in { enable = true;