change shell config to module, and ghostty also.
This commit is contained in:
parent
19d80c007f
commit
414972925c
8 changed files with 176 additions and 89 deletions
91
home/modules/shell/default.nix
Normal file
91
home/modules/shell/default.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkOption mkIf mkMerge;
|
||||
inherit (lib.types) bool;
|
||||
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 = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
whether to use fish shell
|
||||
'';
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
bash = {
|
||||
enable = mkOption {
|
||||
type = bool;
|
||||
default = true;
|
||||
description = ''
|
||||
whether to use bash shell
|
||||
'';
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkMerge [
|
||||
{
|
||||
programs = {
|
||||
starship = cfg-helper {
|
||||
enable = true;
|
||||
};
|
||||
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;
|
||||
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;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue