refactor: switch from modules to import arrays
This commit is contained in:
parent
d893750c09
commit
41eaa38d31
75 changed files with 1870 additions and 2541 deletions
|
|
@ -1,74 +1,63 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
feature = "fish";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
home.shell.enableFishIntegration = true;
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
'';
|
||||
shellAliases = {
|
||||
# keep-sorted start
|
||||
cat = "bat";
|
||||
# cd = "j";
|
||||
cut = "choose";
|
||||
df = "duf";
|
||||
du = "dua";
|
||||
# find = "fd";
|
||||
g = "lazygit";
|
||||
l = "eza";
|
||||
la = "eza -a";
|
||||
ls = "eza";
|
||||
ns = "nh os switch";
|
||||
# curl = "xh";
|
||||
ping = "gping";
|
||||
ps = "procs";
|
||||
# sed = "sd";
|
||||
# grep = "rga";
|
||||
top = "btm";
|
||||
unzip = "ripunzip";
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
# keep-sorted end
|
||||
};
|
||||
plugins = [
|
||||
# INFO: Using this to get shell completion for programs added to the path through nix+direnv.
|
||||
# Issue to upstream into direnv:Add commentMore actions
|
||||
# https://github.com/direnv/direnv/issues/443
|
||||
{
|
||||
name = "completion-sync";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "iynaix";
|
||||
repo = "fish-completion-sync";
|
||||
rev = "4f058ad2986727a5f510e757bc82cbbfca4596f0";
|
||||
sha256 = "sha256-kHpdCQdYcpvi9EFM/uZXv93mZqlk1zCi2DRhWaDyK5g=";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
home.shell.enableFishIntegration = true;
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set fish_greeting
|
||||
'';
|
||||
shellAliases = {
|
||||
# keep-sorted start
|
||||
cat = "bat";
|
||||
# cd = "j";
|
||||
cut = "choose";
|
||||
df = "duf";
|
||||
du = "dua";
|
||||
# find = "fd";
|
||||
g = "lazygit";
|
||||
l = "eza";
|
||||
la = "eza -a";
|
||||
ls = "eza";
|
||||
ns = "nh os switch";
|
||||
# curl = "xh";
|
||||
ping = "gping";
|
||||
ps = "procs";
|
||||
# sed = "sd";
|
||||
# grep = "rga";
|
||||
top = "btm";
|
||||
unzip = "ripunzip";
|
||||
vi = "nvim";
|
||||
vim = "nvim";
|
||||
# keep-sorted end
|
||||
};
|
||||
plugins = [
|
||||
# INFO: Using this to get shell completion for programs added to the path through nix+direnv.
|
||||
# Issue to upstream into direnv:Add commentMore actions
|
||||
# https://github.com/direnv/direnv/issues/443
|
||||
{
|
||||
name = "completion-sync";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "iynaix";
|
||||
repo = "fish-completion-sync";
|
||||
rev = "4f058ad2986727a5f510e757bc82cbbfca4596f0";
|
||||
sha256 = "sha256-kHpdCQdYcpvi9EFM/uZXv93mZqlk1zCi2DRhWaDyK5g=";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
imports = [ ];
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
# https://nixos.wiki/wiki/Fish#Setting_fish_as_your_shell
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
initExtra = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue