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;
pipe
[ [
"Cape" "Cape"
"Akun" "Akun"
] ]
|> map ( [
(map (
hostName: hostName:
mkDeployNode { mkDeployNode {
inherit hostName; inherit hostName;
} }
) ))
|> lib.foldr (a: b: a // b) { }; (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"))
(filterAttrs (
key: _value: key: _value:
!builtins.elem key [ !builtins.elem key [
"modules" "modules"
"extra" "extra"
] ]
) ))
|> builtins.attrNames builtins.attrNames
|> (with lib; flip genAttrs (name: import (rootPath + "/home/${name}/modules"))) (flip genAttrs (name: import (rootPath + "/home/${name}/modules")))
]
) )
// { // {
default = import "${toString rootPath}/home/modules"; default = import "${toString rootPath}/home/modules";
@ -69,11 +71,14 @@ let
in in
{ {
flake = { flake = {
homeConfigurations = lib.foldr (a: b: a // b) { } ( homeConfigurations =
with lib;
foldr (a: b: a // b) { } (
pipe
[ [
# Hostname # Hostname
] ]
|> map (hostName: makeHomeConfiguration { inherit hostName; }) [ (map (hostName: makeHomeConfiguration { inherit hostName; })) ]
); );
inherit homeModules; inherit homeModules;
}; };

View file

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

View file

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

View file

@ -17,7 +17,15 @@ 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 =
(
with lib;
pipe ./alacritty.toml [
builtins.readFile
builtins.fromTOML
]
)
// {
colors = lib.mkForce { }; colors = lib.mkForce { };
font.size = lib.mkForce 16; font.size = lib.mkForce 16;
window.opacity = lib.mkForce 0.8; window.opacity = lib.mkForce 0.8;

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 [
(mapAttrs' (
name: value: name: value:
lib.nameValuePair "nix/inputs/${name}" { lib.nameValuePair "nix/inputs/${name}" {
source = value; 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"))
(mapAttrs (
_name: value: { _name: value: {
flake = lib.mkForce { flake = lib.mkForce {
outPath = value; outPath = value;
}; };
} }
); ))
];
}; };
}; };
} }

View file

@ -3,7 +3,9 @@ final: prev:
let let
inherit (prev) lib; inherit (prev) lib;
in in
[ with lib;
pipe
[
./TrackersListCollection.nix ./TrackersListCollection.nix
./OuterWildsTextAdventure.nix ./OuterWildsTextAdventure.nix
./editor-runtime.nix ./editor-runtime.nix
@ -15,6 +17,8 @@ in
./osu-lazer-bin.nix # typochecker: disable-line ./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,7 +3,9 @@ final: prev:
let let
inherit (prev) lib; inherit (prev) lib;
in in
[ with lib;
pipe
[
./niri.nix ./niri.nix
./spotifyx.nix ./spotifyx.nix
./radicle-explorer.nix ./radicle-explorer.nix
@ -19,6 +21,8 @@ in
# 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 [
(mapAttrsToList (
_: value: '' _: value: ''
mkdir -p $out/${value.name} 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 [
(builtins.mapAttrs (
_: v: { _: v: {
inherit (v) name; inherit (v) name;
value = buildGrammar v; 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;