refactor shell config
This commit is contained in:
parent
aa062722d5
commit
385bfedd8f
9 changed files with 139 additions and 78 deletions
|
|
@ -5,6 +5,12 @@
|
||||||
./emails.nix
|
./emails.nix
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
|
youthlic.programs = {
|
||||||
|
zoxide.enable = true;
|
||||||
|
fzf.enable = true;
|
||||||
|
yazi.enable = true;
|
||||||
|
eza.enable = true;
|
||||||
|
};
|
||||||
services.mpris-proxy.enable = true;
|
services.mpris-proxy.enable = true;
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
spacer
|
spacer
|
||||||
|
|
|
||||||
20
home/modules/programs/bash.nix
Normal file
20
home/modules/programs/bash.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.bash;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.bash = {
|
||||||
|
enable = lib.mkEnableOption "bash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs = {
|
||||||
|
bash = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
./rustypaste-cli.nix
|
./rustypaste-cli.nix
|
||||||
./atuin.nix
|
./atuin.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./shell
|
./bash.nix
|
||||||
|
./fish.nix
|
||||||
./kvm.nix
|
./kvm.nix
|
||||||
./ghostty.nix
|
./ghostty.nix
|
||||||
./wluma.nix
|
./wluma.nix
|
||||||
|
|
@ -25,5 +26,9 @@
|
||||||
./waybar.nix
|
./waybar.nix
|
||||||
./jujutsu.nix
|
./jujutsu.nix
|
||||||
./espanso.nix
|
./espanso.nix
|
||||||
|
./yazi.nix
|
||||||
|
./zoxide.nix
|
||||||
|
./fzf.nix
|
||||||
|
./eza.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
home/modules/programs/eza.nix
Normal file
18
home/modules/programs/eza.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.eza;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.eza = {
|
||||||
|
enable = lib.mkEnableOption "eza";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
programs.eza = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
35
home/modules/programs/fish.nix
Normal file
35
home/modules/programs/fish.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.fish;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.fish = {
|
||||||
|
enable = lib.mkEnableOption "fish";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs = {
|
||||||
|
fish = {
|
||||||
|
enable = true;
|
||||||
|
interactiveShellInit = ''
|
||||||
|
fish_vi_key_bindings
|
||||||
|
'';
|
||||||
|
functions = {
|
||||||
|
__fish_command_not_found_handler = {
|
||||||
|
body = "__fish_default_command_not_found_handler $argv[1]";
|
||||||
|
onEvent = "fish_command_not_found";
|
||||||
|
};
|
||||||
|
fish_greeting = {
|
||||||
|
body = ''
|
||||||
|
fastfetch
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
fastfetch.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
home/modules/programs/fzf.nix
Normal file
18
home/modules/programs/fzf.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.fzf;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.fzf = {
|
||||||
|
enable = lib.mkEnableOption "fzf";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
programs.fzf = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge;
|
|
||||||
fish-cfg = config.youthlic.programs.fish;
|
|
||||||
bash-cfg = config.youthlic.programs.bash;
|
|
||||||
cfg-helper = conf:
|
|
||||||
mkMerge [
|
|
||||||
conf
|
|
||||||
(mkIf fish-cfg.enable {
|
|
||||||
enableFishIntegration = true;
|
|
||||||
})
|
|
||||||
(mkIf bash-cfg.enable {
|
|
||||||
enableBashIntegration = true;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
in {
|
|
||||||
options = {
|
|
||||||
youthlic.programs = {
|
|
||||||
fish = {
|
|
||||||
enable = mkEnableOption "fish";
|
|
||||||
};
|
|
||||||
bash = {
|
|
||||||
enable = mkEnableOption "bash";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = mkMerge [
|
|
||||||
{
|
|
||||||
programs = {
|
|
||||||
zoxide = cfg-helper {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
yazi = cfg-helper {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
fzf = cfg-helper {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
eza = cfg-helper {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
(mkIf fish-cfg.enable {
|
|
||||||
programs = {
|
|
||||||
fish = {
|
|
||||||
enable = true;
|
|
||||||
interactiveShellInit = ''
|
|
||||||
fish_vi_key_bindings
|
|
||||||
'';
|
|
||||||
functions = {
|
|
||||||
__fish_command_not_found_handler = {
|
|
||||||
body = "__fish_default_command_not_found_handler $argv[1]";
|
|
||||||
onEvent = "fish_command_not_found";
|
|
||||||
};
|
|
||||||
fish_greeting = {
|
|
||||||
body = ''
|
|
||||||
fastfetch
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
fastfetch.enable = true;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
(mkIf bash-cfg.enable {
|
|
||||||
programs = {
|
|
||||||
bash = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
18
home/modules/programs/yazi.nix
Normal file
18
home/modules/programs/yazi.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.yazi;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.yazi = {
|
||||||
|
enable = lib.mkEnableOption "yazi";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
programs.yazi = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
18
home/modules/programs/zoxide.nix
Normal file
18
home/modules/programs/zoxide.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.youthlic.programs.zoxide;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
youthlic.programs.zoxide = {
|
||||||
|
enable = lib.mkEnableOption "zoxide";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
programs.zoxide = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue