Switch to nixfmt

This commit is contained in:
SebastianStork 2024-05-19 20:00:58 +02:00
parent 1d70117186
commit b38d2df431
55 changed files with 1559 additions and 1540 deletions

View file

@ -1,22 +1,20 @@
{ config, lib, ... }:
let
cfg = config.myConfig.shell;
in
{
config,
lib,
...
}: let
cfg = config.myConfig.shell;
in {
imports = [
./starship.nix
./enhancement.nix
];
imports = [
./starship.nix
./enhancement.nix
];
options.myConfig.shell = {
bash.enable = lib.mkEnableOption "";
zsh.enable = lib.mkEnableOption "";
};
options.myConfig.shell = {
bash.enable = lib.mkEnableOption "";
zsh.enable = lib.mkEnableOption "";
};
config = {
programs.bash.enable = cfg.bash.enable;
programs.zsh.enable = cfg.zsh.enable;
};
config = {
programs.bash.enable = cfg.bash.enable;
programs.zsh.enable = cfg.zsh.enable;
};
}

View file

@ -1,49 +1,93 @@
{
config,
pkgs,
lib,
...
}: {
options.myConfig.shell.enhancement.enable = lib.mkEnableOption "";
config,
pkgs,
lib,
...
}:
{
options.myConfig.shell.enhancement.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.shell.enhancement.enable {
programs.fzf.enable = true;
config = lib.mkIf config.myConfig.shell.enhancement.enable {
programs.fzf.enable = true;
programs.zoxide = {
enable = true;
options = ["--cmd cd"];
};
programs.zoxide = {
enable = true;
options = [ "--cmd cd" ];
};
home.shellAliases = let
lsAliases = let
listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary";
aliasList = lib.mapCartesianProduct ({
home.shellAliases =
let
lsAliases =
let
listCmd = "${lib.getExe pkgs.eza} --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary";
aliasList =
lib.mapCartesianProduct
(
{
a,
b,
c,
}:
a + b + c) {
a = ["ll" "lt" "l"];
b = ["" "a"];
c = ["" "d" "f"];
}:
a + b + c
)
{
a = [
"ll"
"lt"
"l"
];
b = [
""
"a"
];
c = [
""
"d"
"f"
];
};
convertAliasToCmd = str: "${listCmd} " + (builtins.replaceStrings ["ll" "lt" "l" "a" "d" "f"] ["--long " "--tree " "--oneline --dereference " "--all " "--only-dirs " "--only-files "] str);
aliasAttrs = lib.genAttrs aliasList convertAliasToCmd;
in
aliasAttrs // {ls = "l";};
convertAliasToCmd =
str:
"${listCmd} "
+ (builtins.replaceStrings
[
"ll"
"lt"
"l"
"a"
"d"
"f"
]
[
"--long "
"--tree "
"--oneline --dereference "
"--all "
"--only-dirs "
"--only-files "
]
str
);
aliasAttrs = lib.genAttrs aliasList convertAliasToCmd;
in
aliasAttrs // { ls = "l"; };
catAlias = let
theme =
{
dark = "";
light = "GitHub";
}
.${config.myConfig.de.theme};
in {cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";};
in
lib.mkMerge [
lsAliases
catAlias
];
};
catAlias =
let
theme =
{
dark = "";
light = "GitHub";
}
.${config.myConfig.de.theme};
in
{
cat = "${lib.getExe pkgs.bat} --plain --theme=${theme}";
};
in
lib.mkMerge [
lsAliases
catAlias
];
};
}

View file

@ -1,22 +1,19 @@
{ config, lib, ... }:
{
config,
lib,
...
}: {
options.myConfig.shell.starship.enable = lib.mkEnableOption "";
options.myConfig.shell.starship.enable = lib.mkEnableOption "";
config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable {
enable = true;
config.programs.starship = lib.mkIf config.myConfig.shell.starship.enable {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
enableBashIntegration = true;
enableZshIntegration = true;
settings = {
directory = {
truncation_length = 0;
truncation_symbol = "/";
truncate_to_repo = true;
};
};
settings = {
directory = {
truncation_length = 0;
truncation_symbol = "/";
truncate_to_repo = true;
};
};
};
}