summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2024-01-25 04:15:43 -0500
committerseth <[email protected]>2024-01-25 04:15:43 -0500
commit923af807e5f9e1bc1cc170c519a05be371b8ae84 (patch)
treebe0ec762de6acf151e283ce69547e1fbfbb1cb4b
parentbc5ae75eb21567edae47fcaae4921b0671300f80 (diff)
seth/shell: init nu config
-rw-r--r--flake.lock17
-rw-r--r--flake.nix5
-rw-r--r--users/seth/shell/bash.nix1
-rw-r--r--users/seth/shell/nu.nix36
4 files changed, 59 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock
index 4936ed1..2b19243 100644
--- a/flake.lock
+++ b/flake.lock
@@ -433,6 +433,22 @@
"type": "indirect"
}
},
+ "nu-scripts": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1706107043,
+ "narHash": "sha256-YIBRQ59yjBAoKRUxbLN/Jyor3lhyhhyd4QlSlMz+cj4=",
+ "owner": "nushell",
+ "repo": "nu_scripts",
+ "rev": "f0dac68236ddcc023f4abdff8a78ec00878271ca",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nushell",
+ "repo": "nu_scripts",
+ "type": "github"
+ }
+ },
"openwrt-imagebuilder": {
"inputs": {
"nixpkgs": [
@@ -530,6 +546,7 @@
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable",
+ "nu-scripts": "nu-scripts",
"openwrt-imagebuilder": "openwrt-imagebuilder",
"parts": "parts",
"pre-commit": "pre-commit",
diff --git a/flake.nix b/flake.nix
index 37a80c2..a893371 100644
--- a/flake.nix
+++ b/flake.nix
@@ -94,6 +94,11 @@
};
};
+ nu-scripts = {
+ url = "github:nushell/nu_scripts";
+ flake = false;
+ };
+
openwrt-imagebuilder = {
url = "github:astro/nix-openwrt-imagebuilder";
inputs.nixpkgs.follows = "nixpkgs";
diff --git a/users/seth/shell/bash.nix b/users/seth/shell/bash.nix
index f9a1afa..46c03d4 100644
--- a/users/seth/shell/bash.nix
+++ b/users/seth/shell/bash.nix
@@ -1,6 +1,7 @@
{config, ...}: {
programs.bash = {
enable = true;
+ # TODO: find out if i need this anymore with standalone HM
bashrcExtra = ''
nixfile=${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.sh
[ -e "$nixfile" ] && source "$nixfile"
diff --git a/users/seth/shell/nu.nix b/users/seth/shell/nu.nix
new file mode 100644
index 0000000..1437a97
--- /dev/null
+++ b/users/seth/shell/nu.nix
@@ -0,0 +1,36 @@
+{
+ config,
+ lib,
+ inputs,
+ ...
+}: let
+ theme = "catppuccin-${config.catppuccin.flavour}";
+in {
+ 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;
+ };
+}