feat: add nushell integration config
This commit is contained in:
parent
03a2702281
commit
583cdd7b00
4 changed files with 46 additions and 2 deletions
|
@ -10,6 +10,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
./fish
|
./fish
|
||||||
|
./nushell
|
||||||
./zoxide.nix
|
./zoxide.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./starship
|
./starship
|
||||||
|
@ -22,8 +23,9 @@ in
|
||||||
config = {
|
config = {
|
||||||
myShells = {
|
myShells = {
|
||||||
zsh.enable = false;
|
zsh.enable = false;
|
||||||
fish.enable = true;
|
fish.enable = false;
|
||||||
defaultShell = "fish";
|
nushell.enable = true;
|
||||||
|
defaultShell = "${config.programs.nushell.package}/bin/nu";
|
||||||
prompts.starship.enable = true;
|
prompts.starship.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
programs = {
|
programs = {
|
||||||
direnv = {
|
direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
26
home-manager/stvnliu/shells/nushell/default.nix
Normal file
26
home-manager/stvnliu/shells/nushell/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.myShells.nushell;
|
||||||
|
in
|
||||||
|
with lib; {
|
||||||
|
options = {
|
||||||
|
myShells.nushell = {enable = mkEnableOption "Enables nushell config";};
|
||||||
|
};
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs = {
|
||||||
|
nushell = {
|
||||||
|
enable = true;
|
||||||
|
configFile.source = ./init/config.nu;
|
||||||
|
shellAliases = import ../aliases/default.nix {inherit pkgs;};
|
||||||
|
};
|
||||||
|
carapace = {
|
||||||
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
15
home-manager/stvnliu/shells/nushell/init/config.nu
Normal file
15
home-manager/stvnliu/shells/nushell/init/config.nu
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
$env.config = {
|
||||||
|
show_banner: false,
|
||||||
|
hooks: {
|
||||||
|
pre_prompt: [{ ||
|
||||||
|
if (which direnv | is-empty) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
direnv export json | from json | default {} | load-env
|
||||||
|
if 'ENV_CONVERSIONS' in $env and 'PATH' in $env.ENV_CONVERSIONS {
|
||||||
|
$env.PATH = do $env.ENV_CONVERSIONS.PATH.from_string $env.PATH
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue