summaryrefslogtreecommitdiff
path: root/users/seth/shell/nu.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/seth/shell/nu.nix')
-rw-r--r--users/seth/shell/nu.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/users/seth/shell/nu.nix b/users/seth/shell/nu.nix
new file mode 100644
index 0000000..b5b1529
--- /dev/null
+++ b/users/seth/shell/nu.nix
@@ -0,0 +1,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;
+ };
+ };
+}