mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
Switch to nixfmt
This commit is contained in:
parent
1d70117186
commit
b38d2df431
55 changed files with 1559 additions and 1540 deletions
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue