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 = {
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) { })
];
};
}

View file

@ -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;
};
}

View file

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

View file

@ -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}"))) ];
}

View file

@ -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"
];
};
};
};
}

View file

@ -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 = {

View file

@ -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;
};
}
))
];
};
};
}

View file

@ -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)
]

View file

@ -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)
]

View file

@ -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

View file

@ -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

View file

@ -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;