mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 21:19:07 +01:00
formatter: Remove exception for aliases.nix
This commit is contained in:
parent
36a1e21a00
commit
46971d7b57
2 changed files with 53 additions and 12 deletions
|
|
@ -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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue