mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 00:21:34 +01:00
Switch shell to zsh
This commit is contained in:
parent
a96014bee2
commit
c98192eb68
8 changed files with 1795 additions and 63 deletions
94
modules/home/shell/aliases.nix
Normal file
94
modules/home/shell/aliases.nix
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf config.myConfig.shell.enable {
|
||||
home.shellAliases =
|
||||
let
|
||||
nixAliases =
|
||||
let
|
||||
rebuild = "sudo -v && nh os";
|
||||
in
|
||||
{
|
||||
nrs = "${rebuild} switch";
|
||||
nrt = "${rebuild} test";
|
||||
nrb = "${rebuild} boot";
|
||||
nrrb = "nrb && reboot";
|
||||
};
|
||||
|
||||
lsAliases =
|
||||
let
|
||||
aliasList =
|
||||
lib.mapCartesianProduct
|
||||
(
|
||||
{
|
||||
a,
|
||||
b,
|
||||
c,
|
||||
}:
|
||||
a + b + c
|
||||
)
|
||||
{
|
||||
a = [
|
||||
"ll"
|
||||
"lt"
|
||||
"l"
|
||||
];
|
||||
b = [
|
||||
""
|
||||
"a"
|
||||
];
|
||||
c = [
|
||||
""
|
||||
"d"
|
||||
"f"
|
||||
];
|
||||
};
|
||||
convertAliasToCmd =
|
||||
str:
|
||||
"${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary "
|
||||
+ (builtins.replaceStrings
|
||||
[
|
||||
"ll"
|
||||
"lt"
|
||||
"l"
|
||||
"a"
|
||||
"d"
|
||||
"f"
|
||||
]
|
||||
[
|
||||
"--long "
|
||||
"--tree "
|
||||
"--oneline --dereference "
|
||||
"--all "
|
||||
"--only-dirs "
|
||||
"--only-files "
|
||||
]
|
||||
str
|
||||
);
|
||||
in
|
||||
(lib.genAttrs aliasList convertAliasToCmd) // { ls = "l"; };
|
||||
|
||||
catAlias =
|
||||
let
|
||||
theme =
|
||||
{
|
||||
dark = "";
|
||||
light = "GitHub";
|
||||
}
|
||||
.${config.myConfig.de.theme};
|
||||
in
|
||||
{
|
||||
cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";
|
||||
};
|
||||
in
|
||||
lib.mkMerge [
|
||||
nixAliases
|
||||
lsAliases
|
||||
catAlias
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue