refactoring and nushell

This commit is contained in:
Matt Nish-Lapidus 2025-06-30 02:12:23 -04:00
parent 359e58f469
commit 396aee7db9
10 changed files with 301 additions and 92 deletions

197
flake.lock generated
View file

@ -23,6 +23,53 @@
"type": "github" "type": "github"
} }
}, },
"bash-env-json": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1739453597,
"narHash": "sha256-gyqj5r11DOfXd23LT7qwRLEoWvpHUbxbd28QJnlWTaQ=",
"owner": "tesujimath",
"repo": "bash-env-json",
"rev": "0a02cf14cb7ff975c9eab9e77fae3413e61a91af",
"type": "github"
},
"original": {
"owner": "tesujimath",
"ref": "main",
"repo": "bash-env-json",
"type": "github"
}
},
"bash-env-nushell": {
"inputs": {
"bash-env-json": [
"bash-env-json"
],
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1739453743,
"narHash": "sha256-CqcDKfQSKA2MK204KrbR2/hF1DRuY/sE1bO8XOLj+Ww=",
"owner": "tesujimath",
"repo": "bash-env-nushell",
"rev": "4699a7236934140af6b4b181a2f679a80ea16379",
"type": "github"
},
"original": {
"owner": "tesujimath",
"ref": "main",
"repo": "bash-env-nushell",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -90,11 +137,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1751216990, "lastModified": 1751250385,
"narHash": "sha256-KMcGSznyttkf3C2Gv4LNCPYOfvjj7Qk/Mu2Og2yCsbk=", "narHash": "sha256-+jWCrLW15eNsfzppVpPkd7Th7b1Dx+aKQfHPzYxzLWY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "562e5da816da90627ed5775d4ba6f968bde0ff57", "rev": "28a7010a46ee17016c9b37be86f4ce4796c47a71",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -265,6 +312,24 @@
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
"locked": {
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
@ -279,34 +344,16 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_5" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1710146030,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -333,6 +380,42 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": {
"inputs": {
"systems": "systems_7"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_8"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"freetype2": { "freetype2": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -502,7 +585,7 @@
"pyproject-build-systems": "pyproject-build-systems", "pyproject-build-systems": "pyproject-build-systems",
"pyproject-nix": "pyproject-nix", "pyproject-nix": "pyproject-nix",
"systemd-nix": "systemd-nix", "systemd-nix": "systemd-nix",
"systems": "systems_2", "systems": "systems_4",
"uv2nix": "uv2nix" "uv2nix": "uv2nix"
}, },
"locked": { "locked": {
@ -653,7 +736,7 @@
"nix-appimage": { "nix-appimage": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_3", "flake-compat": "flake-compat_3",
"flake-utils": "flake-utils", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
@ -709,7 +792,7 @@
"nixpkgs" "nixpkgs"
], ],
"nixpkgs-lib": "nixpkgs-lib_3", "nixpkgs-lib": "nixpkgs-lib_3",
"systems": "systems_3" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1748538518, "lastModified": 1748538518,
@ -1036,6 +1119,8 @@
"root": { "root": {
"inputs": { "inputs": {
"affinity-nix": "affinity-nix", "affinity-nix": "affinity-nix",
"bash-env-json": "bash-env-json",
"bash-env-nushell": "bash-env-nushell",
"disko": "disko", "disko": "disko",
"emacs-lsp-booster": "emacs-lsp-booster", "emacs-lsp-booster": "emacs-lsp-booster",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
@ -1180,16 +1265,16 @@
}, },
"systems_2": { "systems_2": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1681028828,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default-linux", "repo": "default",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default-linux", "repo": "default",
"type": "github" "type": "github"
} }
}, },
@ -1210,16 +1295,16 @@
}, },
"systems_4": { "systems_4": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1689347949,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default-linux",
"type": "github" "type": "github"
} }
}, },
@ -1253,6 +1338,36 @@
"type": "github" "type": "github"
} }
}, },
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
@ -1375,7 +1490,7 @@
}, },
"wezterm": { "wezterm": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_4",
"freetype2": "freetype2", "freetype2": "freetype2",
"harfbuzz": "harfbuzz", "harfbuzz": "harfbuzz",
"libpng": "libpng", "libpng": "libpng",
@ -1401,7 +1516,7 @@
}, },
"xwayland-satellite": { "xwayland-satellite": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_5",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -1456,7 +1571,7 @@
}, },
"yazi": { "yazi": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_6",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],

View file

@ -73,6 +73,17 @@
url = "github:wez/wezterm?dir=nix"; url = "github:wez/wezterm?dir=nix";
}; };
bash-env-json = {
url = "github:tesujimath/bash-env-json/main";
inputs.nixpkgs.follows = "nixpkgs";
};
bash-env-nushell = {
url = "github:tesujimath/bash-env-nushell/main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.bash-env-json.follows = "bash-env-json";
};
sops-nix = { sops-nix = {
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -43,6 +43,11 @@
}); });
}) })
(final: prev: {
bash-env-json = inputs.bash-env-json.packages.x86_64-linux.default;
bash-env-nushell = inputs.bash-env-nushell.packages.x86_64-linux.default;
})
(final: prev: { (final: prev: {
manifold = prev.manifold.overrideAttrs (old: { manifold = prev.manifold.overrideAttrs (old: {
cmakeFlags = [ cmakeFlags = [
@ -344,15 +349,16 @@
programs.java.enable = true; programs.java.enable = true;
# enable fish and launch it from bash for interactive shells # enable alternate shells and launch it from bash for interactive shells
programs.fish.enable = true; programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ]; # environment.pathsToLink = [ "/share/fish" ];
environment.shells = [ pkgs.nushell ];
programs.bash = { programs.bash = {
interactiveShellInit = '' interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION exec ${pkgs.nushell}/bin/nu $LOGIN_OPTION
fi fi
''; '';
}; };

View file

@ -35,5 +35,6 @@
gnomeExtensions.appindicator gnomeExtensions.appindicator
gnome-settings-daemon gnome-settings-daemon
swayidle swayidle
nushell
]; ];
} }

View file

@ -1,6 +1,11 @@
{ pkgs-local, pkgs-stable, inputs, pkgs, ... }: { config, lib, pkgs-stable, inputs, pkgs, ... }:
{ {
imports = [
./shell-conf/nushell/nushell.nix
./shell-conf/fish/fish.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [
inputs.isd.packages.x86_64-linux.default inputs.isd.packages.x86_64-linux.default
@ -87,6 +92,8 @@
fishPlugins.colored-man-pages fishPlugins.colored-man-pages
television television
bash-env-json
bash-env-nushell
]; ];
programs = { programs = {
@ -95,7 +102,6 @@
}; };
nix-index = { nix-index = {
enable = true; enable = true;
enableFishIntegration = true;
}; };
direnv = { direnv = {
enable = true; enable = true;
@ -106,44 +112,10 @@
}; };
}; };
}; };
nushell = {
enable = true;
};
fish = {
enable = true;
shellAliases = {
"em" = "emacsclient -n -r";
"mkdir" = "mkdir -pv";
"gt" = "gtrash";
"rm" = "gtrash put";
};
# change fzf variable search to C-M-v
interactiveShellInit = ''
bind --erase \ct
fzf_configure_bindings --variables=\e\cv
'';
plugins = [
{
name = "upto";
src = pkgs.fetchFromGitHub {
owner = "Markcial";
repo = "upto";
rev = "2d1f35453fb55747d50da8c1cb1809840f99a646";
sha256 = "sha256-Lv2XtP2x9dkIkUUjMBWVpAs/l55Ztu7gIjKYH6ZzK4s=";
};
}
];
};
zoxide = { zoxide = {
enableFishIntegration = true;
enableBashIntegration = true;
enable = true; enable = true;
}; };
starship = { starship = {
enableFishIntegration = true;
enableBashIntegration = true;
enable = true; enable = true;
}; };
ripgrep = { ripgrep = {
@ -152,13 +124,9 @@
}; };
ghostty = { ghostty = {
enable = true; enable = true;
# settings = {
# theme = "";
# };
}; };
wezterm = { wezterm = {
enable = true; enable = true;
enableBashIntegration = true;
package = inputs.wezterm.packages.${pkgs.system}.default; package = inputs.wezterm.packages.${pkgs.system}.default;
}; };
bat = { bat = {
@ -166,8 +134,6 @@
}; };
eza = { eza = {
enable = true; enable = true;
enableFishIntegration = true;
enableBashIntegration = true;
git = true; git = true;
icons = "auto"; icons = "auto";
colors = "auto"; colors = "auto";
@ -177,8 +143,6 @@
}; };
fzf = { fzf = {
enable = true; enable = true;
# enableFishIntegration = false;
# enableBashIntegration = true;
}; };
broot = { broot = {
enable = true; enable = true;

View file

@ -0,0 +1,32 @@
{ config, lib, pkgs, ... }:
{
programs.fish = {
enable = true;
shellAliases = {
"em" = "emacsclient -n -r";
"mkdir" = "mkdir -pv";
"gtr" = "gtrash -r";
"rmr" = "gtrash -r";
"rm" = "gtrash put";
"lg" = "lazygit";
};
# change fzf variable search to C-M-v
interactiveShellInit = ''
bind --erase \ct
fzf_configure_bindings --variables=\e\cv
'';
plugins = [
{
name = "upto";
src = pkgs.fetchFromGitHub {
owner = "Markcial";
repo = "upto";
rev = "2d1f35453fb55747d50da8c1cb1809840f99a646";
sha256 = "sha256-Lv2XtP2x9dkIkUUjMBWVpAs/l55Ztu7gIjKYH6ZzK4s=";
};
}
];
};
}

View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:
{
programs.fish = {
enable = true;
shellAliases = {
"em" = "emacsclient -n -r";
"mkdir" = "mkdir -pv";
"gtr" = "gtrash -r";
"rm" = "gtrash put";
};
# change fzf variable search to C-M-v
interactiveShellInit = ''
bind --erase \ct
fzf_configure_bindings --variables=\e\cv
'';
plugins = [
{
name = "upto";
src = pkgs.fetchFromGitHub {
owner = "Markcial";
repo = "upto";
rev = "2d1f35453fb55747d50da8c1cb1809840f99a646";
sha256 = "sha256-Lv2XtP2x9dkIkUUjMBWVpAs/l55Ztu7gIjKYH6ZzK4s=";
};
}
];
};
}

View file

@ -1,4 +0,0 @@
function lg --wraps=lazygit --description 'alias lg=lazygit'
lazygit $argv
end

View file

@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
{
programs.nushell = {
enable = true;
shellAliases = {
"em" = "emacsclient -n -r";
"gtr" = "gtrash -r";
"rm" = "gtrash put";
"rmr" = "gtrash -r";
"lg" = "lazygit";
};
loginFile.text = ''
${pkgs.figlet}/bin/figlet -f ($env.HOME)/.local/share/flf/wavy.flf (hostname)
'';
environmentVariables = {
ENV_CONVERSIONS.PATH = {
from_string = lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }";
to_string = lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }";
};
};
settings = {
show_banner = false;
};
};
}

View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
{
programs.nushell = {
enable = true;
shellAliases = {
"em" = "emacsclient -n -r";
"gtr" = "gtrash -r";
"rm" = "gtrash put";
};
loginFile.text = ''
${pkgs.figlet}/bin/figlet -f ($env.HOME)/.local/share/flf/wavy.flf (hostname)
'';
environmentVariables = {
ENV_CONVERSIONS.PATH = {
from_string = lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }";
to_string = lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }";
};
};
settings = {
show_banner = false;
};
};
}