cleanup code, migrate to modules + start rewriting ddt4all derivation
This commit is contained in:
77
modules/home-manager/fish.nix
Normal file
77
modules/home-manager/fish.nix
Normal file
@ -0,0 +1,77 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.modules.fish = {
|
||||
enable = lib.mkEnableOption "Fish integration";
|
||||
enableDefaultAliases = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable default aliases and abbreviations";
|
||||
};
|
||||
|
||||
enableStarship = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable Starship prompt";
|
||||
};
|
||||
|
||||
functions = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
description = "Fish function definitions";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.modules.fish.enable {
|
||||
programs.nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
programs.starship = lib.mkIf config.modules.fish.enableStarship {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
cat ~/.cache/wal/sequences
|
||||
'';
|
||||
|
||||
shellAliases = lib.mkIf config.modules.fish.enableDefaultAliases {
|
||||
".." = "cd ..";
|
||||
"..." = "cd ../..";
|
||||
"...." = "cd ../../../";
|
||||
"....." = "cd ../../../../";
|
||||
|
||||
"cp" = "cp -v";
|
||||
"ddf" = "df -h";
|
||||
"etc" = "erd -H";
|
||||
"mkdir" = "mkdir -p";
|
||||
"mv" = "mv -v";
|
||||
"rm" = "rm -v";
|
||||
"rr" = "rm -rf";
|
||||
|
||||
"neofetch" = "fastfetch";
|
||||
};
|
||||
|
||||
shellAbbrs = lib.mkIf config.modules.fish.enableDefaultAliases {
|
||||
gaa = "git add -A";
|
||||
ga = "git add";
|
||||
gbd = "git branch --delete";
|
||||
gb = "git branch";
|
||||
gc = "git commit";
|
||||
gcm = "git commit -m";
|
||||
gcob = "git checkout -b";
|
||||
gco = "git checkout";
|
||||
gd = "git diff";
|
||||
gl = "git log";
|
||||
gp = "git push";
|
||||
gs = "git status";
|
||||
};
|
||||
|
||||
functions = config.modules.fish.functions;
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user