feat: Remove |> op from config to disable pipe-operator feature

This commit is contained in:
ulic-youthlic 2025-11-07 23:54:49 +08:00
parent b418f7ca4b
commit 0bdc1f142c
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
12 changed files with 167 additions and 121 deletions

View file

@ -39,16 +39,20 @@ in
}; };
config = { config = {
flake.deploy.nodes = flake.deploy.nodes =
[ with lib;
"Cape" pipe
"Akun" [
] "Cape"
|> map ( "Akun"
hostName: ]
mkDeployNode { [
inherit hostName; (map (
} hostName:
) mkDeployNode {
|> lib.foldr (a: b: a // b) { }; inherit hostName;
}
))
(foldr (a: b: a // b) { })
];
}; };
} }

View file

@ -9,18 +9,20 @@ let
inherit (self) outputs; inherit (self) outputs;
homeModules = homeModules =
( (
(rootPath + "/home") with lib;
|> builtins.readDir pipe (rootPath + "/home") [
|> lib.filterAttrs (_key: value: value == "directory") builtins.readDir
|> lib.filterAttrs ( (filterAttrs (_key: value: value == "directory"))
key: _value: (filterAttrs (
!builtins.elem key [ key: _value:
"modules" !builtins.elem key [
"extra" "modules"
] "extra"
) ]
|> builtins.attrNames ))
|> (with lib; flip genAttrs (name: import (rootPath + "/home/${name}/modules"))) builtins.attrNames
(flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
]
) )
// { // {
default = import "${toString rootPath}/home/modules"; default = import "${toString rootPath}/home/modules";
@ -69,12 +71,15 @@ let
in in
{ {
flake = { flake = {
homeConfigurations = lib.foldr (a: b: a // b) { } ( homeConfigurations =
[ with lib;
# Hostname foldr (a: b: a // b) { } (
] pipe
|> map (hostName: makeHomeConfiguration { inherit hostName; }) [
); # Hostname
]
[ (map (hostName: makeHomeConfiguration { inherit hostName; })) ]
);
inherit homeModules; inherit homeModules;
}; };
} }

View file

@ -30,11 +30,13 @@ in
}; };
}; };
in in
[ with lib;
"Tytonidae" pipe
"Cape" [
"Akun" "Tytonidae"
] "Cape"
|> (with lib; flip genAttrs makeNixosConfiguration); "Akun"
]
[ (flip genAttrs makeNixosConfiguration) ];
}; };
} }

View file

@ -11,9 +11,11 @@ let
in in
{ {
flake.overlays = flake.overlays =
[ with lib;
"modifications" pipe
"additions" [
] "modifications"
|> (with lib; flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))); "additions"
]
[ (flip genAttrs (name: importWithArgs (rootPath + "/overlays/${name}"))) ];
} }

View file

@ -17,14 +17,22 @@ in
programs.alacritty = { programs.alacritty = {
enable = true; enable = true;
package = pkgs.alacritty_git; package = pkgs.alacritty_git;
settings = (./alacritty.toml |> builtins.readFile |> builtins.fromTOML) // { settings =
colors = lib.mkForce { }; (
font.size = lib.mkForce 16; with lib;
window.opacity = lib.mkForce 0.8; pipe ./alacritty.toml [
general.import = [ builtins.readFile
"${pkgs.alacritty-theme}/share/alacritty-theme/gruvbox_dark.toml" 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"
];
};
}; };
}; };
} }

View file

@ -56,7 +56,12 @@ in
enable = true; enable = true;
defaultEditor = true; defaultEditor = true;
extraPackages = cfg.extraPackages; extraPackages = cfg.extraPackages;
settings = ./config.toml |> builtins.readFile |> builtins.fromTOML; settings =
with lib;
pipe ./config.toml [
builtins.readFile
builtins.fromTOML
];
languages = lib.recursiveUpdate { languages = lib.recursiveUpdate {
language-server = { language-server = {
neocmakelsp = { neocmakelsp = {

View file

@ -9,13 +9,15 @@
{ {
config = { config = {
environment.etc = environment.etc =
inputs with lib;
|> lib.mapAttrs' ( pipe inputs [
name: value: (mapAttrs' (
lib.nameValuePair "nix/inputs/${name}" { name: value:
source = value; lib.nameValuePair "nix/inputs/${name}" {
} source = value;
); }
))
];
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = true; allowUnfree = true;
@ -72,9 +74,7 @@
experimental-features = [ experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
] ];
++ (lib.optional config.lix.enable "pipe-operator")
++ (lib.optional (!config.lix.enable) "pipe-operators");
warn-dirty = false; warn-dirty = false;
system-features = [ system-features = [
"kvm" "kvm"
@ -85,15 +85,17 @@
}; };
package = pkgs.nix; package = pkgs.nix;
registry = registry =
inputs with lib;
|> lib.filterAttrs (name: _value: name != "nixpkgs") pipe inputs [
|> lib.mapAttrs ( (filterAttrs (name: _value: name != "nixpkgs"))
_name: value: { (mapAttrs (
flake = lib.mkForce { _name: value: {
outPath = value; flake = lib.mkForce {
}; outPath = value;
} };
); }
))
];
}; };
}; };
} }

View file

@ -3,18 +3,22 @@ final: prev:
let let
inherit (prev) lib; inherit (prev) lib;
in in
[ with lib;
./TrackersListCollection.nix pipe
./OuterWildsTextAdventure.nix [
./editor-runtime.nix ./TrackersListCollection.nix
./wallpapers.nix ./OuterWildsTextAdventure.nix
./rime-yuhaostar.nix ./editor-runtime.nix
./rime-all.nix ./wallpapers.nix
./nixvim.nix ./rime-yuhaostar.nix
./doom-emacs.nix ./rime-all.nix
./osu-lazer-bin.nix # typochecker: disable-line ./nixvim.nix
./doom-emacs.nix
./osu-lazer-bin.nix # typochecker: disable-line
./pkgsNoCuda.nix ./pkgsNoCuda.nix
] ]
|> map (file: import file args) [
|> (overlays: (lib.composeManyExtensions overlays) final prev) (map (file: import file args))
(overlays: (lib.composeManyExtensions overlays) final prev)
]

View file

@ -3,22 +3,26 @@ final: prev:
let let
inherit (prev) lib; inherit (prev) lib;
in in
[ with lib;
./niri.nix pipe
./spotifyx.nix [
./radicle-explorer.nix ./niri.nix
./wshowkeys.nix ./spotifyx.nix
# ./QQ.nix ./radicle-explorer.nix
./helix.nix ./wshowkeys.nix
./cliphist.nix # ./QQ.nix
./zulip.nix ./helix.nix
./spotifyd.nix ./cliphist.nix
./nautilus.nix ./zulip.nix
./neovim-nightly.nix ./spotifyd.nix
./vim.nix ./nautilus.nix
./neovim-nightly.nix
./vim.nix
# Nur # Nur
./nur.nix ./nur.nix
] ]
|> map (file: import file args) [
|> (overlays: (lib.composeManyExtensions overlays) final prev) (map (file: import file args))
(overlays: (lib.composeManyExtensions overlays) final prev)
]

View file

@ -60,26 +60,30 @@ let
runHook postFixup runHook postFixup
''; '';
}; };
grammars = srcs |> lib.filterAttrs (key: _: lib.hasPrefix "tree-sitter-" key); grammars = with lib; pipe srcs [ (filterAttrs (key: _: hasPrefix "tree-sitter-" key)) ];
queries = queries =
grammars with lib;
|> lib.mapAttrsToList ( pipe grammars [
_: value: '' (mapAttrsToList (
mkdir -p $out/${value.name} _: value: ''
mkdir -p $out/${value.name}
ln -s ${value.src}/queries/* $out/${value.name}/ ln -s ${value.src}/queries/* $out/${value.name}/
'' ''
); ))
];
grammarLinks = grammarLinks =
grammars with lib;
|> builtins.mapAttrs ( pipe grammars [
_: v: { (builtins.mapAttrs (
inherit (v) name; _: v: {
value = buildGrammar v; inherit (v) name;
} value = buildGrammar v;
) }
|> lib.mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"); ))
(mapAttrsToList (_: value: "ln -s ${value.value}/${value.name}.so $out/${value.name}.so"))
];
grammarDir = runCommandLocal "helix-grammars" { } '' grammarDir = runCommandLocal "helix-grammars" { } ''
mkdir -p $out mkdir -p $out

View file

@ -7,9 +7,10 @@
let let
wallpapers = wallpapers =
with lib; with lib;
srcs pipe srcs [
|> filterAttrs (name: _value: hasPrefix "wallpaper" name) (filterAttrs (name: _value: hasPrefix "wallpaper" name))
|> concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}"); (concatMapAttrsStringSep "\n" (name: value: "ln -s ${value.src} $out/${name}"))
];
in in
runCommandLocal "wallpapers" { } '' runCommandLocal "wallpapers" { } ''
mkdir -p $out mkdir -p $out

View file

@ -1,6 +1,6 @@
{ {
perSystem = perSystem =
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
treefmt = { treefmt = {
programs = { programs = {
@ -41,7 +41,12 @@
}; };
typos = typos =
let let
config = ./.typos.toml |> builtins.readFile |> builtins.fromTOML; config =
with lib;
pipe ./.typos.toml [
builtins.readFile
builtins.fromTOML
];
in in
{ {
enable = true; enable = true;