configuration.nix/modules/home/programs/nushell/default.nix

62 lines
1.4 KiB
Nix
Raw Normal View History

2024-01-29 08:48:15 +01:00
{
programs = {
nushell = {
enable = true;
2024-01-29 10:14:39 +01:00
environmentVariables = {
PASSWORD_STORE_DIR = "([$env.HOME, '.password-store'] | str join '/')";
};
shellAliases = {
gcal = ''
bash -c "cal $(date +%Y)"
'';
la = "ls -al";
ssh = "TERM=xterm-256color ssh";
dev = "nix develop --command $env.SHELL";
torrent = "transmission-remote";
vi = "nvim";
};
loginFile.text = ''
if (tty) == "/dev/tty1" {
sway
}
'';
2024-01-29 08:48:15 +01:00
extraConfig = ''
let carapace_completer = {|spans|
carapace $spans.0 nushell $spans | from json
}
$env.config = {
show_banner: false,
completions: {
2024-01-29 10:14:39 +01:00
quick: true
partial: true
algorithm: "fuzzy"
2024-01-29 08:48:15 +01:00
external: {
enable: true
max_results: 100
2024-01-29 10:14:39 +01:00
completer: $carapace_completer
2024-01-29 08:48:15 +01:00
}
}
2024-01-29 10:14:39 +01:00
}
2024-01-29 10:23:54 +01:00
$env.PATH = ($env.PATH | split row (char esep) |
append ([$env.HOME, '.local', 'bin'] | str join '/')
)
2024-01-29 08:48:15 +01:00
'';
};
carapace = {
enable = true;
enableNushellIntegration = true;
};
starship = {
enable = true;
2024-01-29 10:14:39 +01:00
enableNushellIntegration = true;
2024-01-29 08:48:15 +01:00
settings = {
add_newline = true;
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
};
};
};
}