blob: b5b15291dd68644fb827f6516f04ad542058b927 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
{
config,
lib,
inputs,
...
}: let
cfg = config.seth.shell.nushell;
theme = "catppuccin-${config.catppuccin.flavour}";
in {
options.seth.shell.nushell = {
enable = lib.mkEnableOption "Nushell configuration";
};
config = lib.mkIf cfg.enable {
programs = {
nushell = {
enable = true;
configFile.text = ''
def "nixgc" [] {
sudo nix-collect-garbage -d; nix-collect-garbage -d
}
'';
envFile.text = ''
use ${inputs.nu-scripts}/themes/nu-themes/${theme}.nu
$env.config.color_config = (${theme})
'';
inherit (config.home) shellAliases;
};
bash.initExtra = lib.mkAfter ''
if [[ $(ps --no-header --pid=$PPID --format=comm) != "nu" && -z ''${BASH_EXECUTION_STRING} ]]; then
exec ${lib.getExe config.programs.nushell.package}
fi
'';
# builtin `ls` is good here!
eza.enable = lib.mkForce false;
};
};
}
|