feat: added new configuration for enabling fish shell
This commit is contained in:
parent
51c7913ad5
commit
8bdd51e77a
7 changed files with 73 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
{pkgs}: {
|
||||
cd = "z";
|
||||
cdi = "zi";
|
||||
#cd = "z";
|
||||
#cdi = "zi";
|
||||
ls = "${pkgs.eza}/bin/exa";
|
||||
cat = "${pkgs.bat}/bin/bat";
|
||||
ll = "ls -l";
|
||||
|
|
|
@ -9,19 +9,20 @@ in
|
|||
with lib; {
|
||||
imports = [
|
||||
./zsh.nix
|
||||
./fish.nix
|
||||
./direnv.nix
|
||||
./starship
|
||||
];
|
||||
|
||||
options.myShells = {
|
||||
defaultShell = with types; mkOption {type = str;};
|
||||
enable = mkEnableOption "Enables the shell customisation module.";
|
||||
useZsh = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
config = {
|
||||
myShells = {
|
||||
zsh.enable = cfg.useZsh;
|
||||
zsh.enable = false;
|
||||
fish.enable = true;
|
||||
defaultShell = "fish";
|
||||
prompts.starship.enable = true;
|
||||
};
|
||||
};
|
||||
|
|
32
home-manager/stvnliu/shells/fish.nix
Normal file
32
home-manager/stvnliu/shells/fish.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myShells.fish;
|
||||
in
|
||||
with lib; {
|
||||
options = {
|
||||
myShells.fish = {
|
||||
enable = mkEnableOption "Enables fish and components.";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
shellAliases = import ./aliases {inherit pkgs;};
|
||||
plugins = [
|
||||
#{
|
||||
# name = "z";
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "jethrokuan";
|
||||
# repo = "z";
|
||||
# rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a";
|
||||
# sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh";
|
||||
# };
|
||||
#}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -17,7 +17,8 @@ in
|
|||
config = {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
enableZshIntegration = config.myShells.zsh.enable;
|
||||
enableFishIntegration = config.myShells.fish.enable;
|
||||
settings = builtins.fromTOML (builtins.readFile cfg.confPath);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue