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
|
|
@ -12,7 +12,7 @@
|
|||
enable = true;
|
||||
options = [ "--cmd cd" ];
|
||||
};
|
||||
|
||||
|
||||
home = {
|
||||
packages = [
|
||||
pkgs.eza
|
||||
|
|
@ -23,12 +23,25 @@
|
|||
let
|
||||
lsAliases =
|
||||
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 =
|
||||
aliasParts:
|
||||
aliasParts
|
||||
|> lib.filter (aliasPart: aliasPart != "")
|
||||
|> lib.map (aliasPart:
|
||||
|> lib.map (
|
||||
aliasPart:
|
||||
{
|
||||
"l" = "--oneline --dereference";
|
||||
"ll" = "--long";
|
||||
|
|
@ -37,18 +50,47 @@
|
|||
"d" = "--only-dirs";
|
||||
"f" = "--only-files";
|
||||
}
|
||||
.${aliasPart})
|
||||
.${aliasPart}
|
||||
)
|
||||
|> (flags: eza ++ flags)
|
||||
|> lib.concatStringsSep " ";
|
||||
in
|
||||
{ format = [ "l" "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
|
||||
lsAliases // {
|
||||
{
|
||||
format = [
|
||||
"l"
|
||||
"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
|
||||
lsAliases
|
||||
// {
|
||||
ls = "l";
|
||||
btm = "btm --group_processes";
|
||||
cat =
|
||||
let
|
||||
theme =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue