formatter: Remove exception for aliases.nix

This commit is contained in:
SebastianStork 2026-02-15 19:43:01 +01:00
parent 36a1e21a00
commit 46971d7b57
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
2 changed files with 53 additions and 12 deletions

View file

@ -11,7 +11,6 @@
prettier.enable = true; prettier.enable = true;
just.enable = true; just.enable = true;
}; };
settings.formatter.nixfmt.excludes = [ "modules/home/programs/shell/aliases.nix" ];
}).config.build.wrapper; }).config.build.wrapper;
}; };
} }

View file

@ -23,12 +23,25 @@
let let
lsAliases = lsAliases =
let let
eza = [ "eza" "--header" "--group" "--time-style=long-iso" "--group-directories-first" "--sort=name" "--icons=auto" "--git" "--git-repos-no-status" "--binary" ]; eza = [
"eza"
"--header"
"--group"
"--time-style=long-iso"
"--group-directories-first"
"--sort=name"
"--icons=auto"
"--git"
"--git-repos-no-status"
"--binary"
];
aliasPartsToCommand = aliasPartsToCommand =
aliasParts: aliasParts:
aliasParts aliasParts
|> lib.filter (aliasPart: aliasPart != "") |> lib.filter (aliasPart: aliasPart != "")
|> lib.map (aliasPart: |> lib.map (
aliasPart:
{ {
"l" = "--oneline --dereference"; "l" = "--oneline --dereference";
"ll" = "--long"; "ll" = "--long";
@ -37,18 +50,47 @@
"d" = "--only-dirs"; "d" = "--only-dirs";
"f" = "--only-files"; "f" = "--only-files";
} }
.${aliasPart}) .${aliasPart}
)
|> (flags: eza ++ flags) |> (flags: eza ++ flags)
|> lib.concatStringsSep " "; |> lib.concatStringsSep " ";
in in
{ format = [ "l" "ll" "lt" ]; visibility = [ "" "a" ]; restriction = [ "" "d" "f" ]; } {
|> lib.mapCartesianProduct ({ format, visibility, restriction, }: [ format visibility restriction ]) format = [
|> lib.map (aliasParts: lib.nameValuePair (lib.concatStrings aliasParts) (aliasPartsToCommand aliasParts)) "l"
|> lib.listToAttrs; "ll"
"lt"
];
visibility = [
""
"a"
];
restriction = [
""
"d"
"f"
];
}
|> lib.mapCartesianProduct (
{
format,
visibility,
restriction,
}:
[
format
visibility
restriction
]
)
|> lib.map (
aliasParts: lib.nameValuePair (lib.concatStrings aliasParts) (aliasPartsToCommand aliasParts)
)
|> lib.listToAttrs;
in in
lsAliases // { lsAliases
// {
ls = "l"; ls = "l";
btm = "btm --group_processes";
cat = cat =
let let
theme = theme =