cleanup shell (remove xonsh)

This commit is contained in:
cswimr 2025-02-04 13:32:43 -06:00
parent 28f4c81795
commit 7ed053524f
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -1,11 +1,5 @@
{ config, pkgs, ... }:
{
# enable bash completions
# even though we don't use bash as our shell, xonsh uses bash completion scripts
programs.bash.completion.enable = true;
programs.command-not-found.enable = false;
environment.systemPackages = with pkgs; [
any-nix-shell
];
@ -57,9 +51,10 @@
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
'';
promptInit = ''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
'';
promptInit = # zsh
''
${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin
'';
shellAliases = {
ff = "fastfetch";
@ -74,7 +69,7 @@
git = "hub";
cc = "fj --host=https://www.coastalcommits.com --style=fancy";
cb = "fj --host https://codeberg.org --style=fancy";
eza = "--time-style=long-iso --icons=auto --hyperlink";
eza = "eza --time-style=long-iso --icons=auto --hyperlink";
l = "eza -lhg";
la = "eza -lAh";
ll = "l";
@ -99,45 +94,6 @@
histFile = "$HOME/.zsh_history";
};
programs.xonsh =
let
bashcfg = config.programs.bash;
#xontrib-cd = pkgs.callPackage ../packages/xontribs/xontrib-cd.nix { inherit pkgs; };
xontrib-clp = pkgs.callPackage ../packages/xontribs/xontrib-clp.nix { inherit pkgs; };
xontrib-direnv = pkgs.callPackage ../packages/xontribs/xontrib-direnv.nix { inherit pkgs; };
xontrib-sh = pkgs.callPackage ../packages/xontribs/xontrib-sh.nix { inherit pkgs; };
in
{
enable = true;
config = ''
$BASH_COMPLETIONS = ('${bashcfg.completion.package}/etc/profile.d/bash_completion.sh')
$UPDATE_OS_ENVIRON = True
$XONTRIB_CLP_ALIAS = 'shutil'
#xontrib load cd
xontrib load clp
xontrib load direnv
xontrib load sh
source-bash ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
tmpfile = $(mktemp)
gh copilot alias -- bash > @(tmpfile)
source-bash @(tmpfile)
execx($(${pkgs.any-nix-shell}/bin/any-nix-shell xonsh --info-right))
'';
package = pkgs.xonsh.override {
extraPackages = ps: [
pkgs.python311Packages.rich
xontrib-clp
xontrib-direnv
xontrib-sh
];
};
};
#TODO: Submit a PR to nixpkgs to add xonsh support to the Starship module
# After that, we can remove this import and the disabledModules line
disabledModules = [ "programs/starship.nix" ];
imports = [ /bulk/home/cswimr/Projects/nixpkgs/nixos/modules/programs/starship.nix ];
# starship - a customizable prompt for any shell
programs.starship = {
enable = true;