Enable Nushell and Carapace
Add nushell and some basic settings so that it works politely Add carapace configuration to both nushell and Xonsh
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
./bash.nix
|
./bash.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
|
./nushell.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./vim
|
./vim
|
||||||
./xonsh.nix
|
./xonsh.nix
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
programs = {
|
||||||
|
carapace = {
|
||||||
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
};
|
||||||
|
nushell = {
|
||||||
|
enable = true;
|
||||||
|
environmentVariables = {
|
||||||
|
AWS_SHARED_CREDENTIALS_FILE = "/run/agenix/cache-credentials";
|
||||||
|
GOPATH = "${config.home.homeDirectory}/src/go";
|
||||||
|
GOBIN = "${config.home.homeDirectory}/src/bin";
|
||||||
|
LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = "1";
|
||||||
|
SWORD_PATH = "${config.home.homeDirectory}/.sword/";
|
||||||
|
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
|
||||||
|
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
use std/util "path add"
|
||||||
|
path add ${config.home.homeDirectory}/src/bin
|
||||||
|
path add /opt/homebrew/bin
|
||||||
|
path add /run/current-system/sw/bin
|
||||||
|
path add ${config.home.homeDirectory}/.nix-profile/bin
|
||||||
|
'';
|
||||||
|
settings = {
|
||||||
|
buffer_editor = lib.getExe config.programs.nixvim.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
starship = {
|
||||||
|
enable = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+83
-75
@@ -10,87 +10,95 @@
|
|||||||
nvd
|
nvd
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.xonsh = {
|
programs = {
|
||||||
enable = true;
|
carapace = {
|
||||||
|
enable = true;
|
||||||
sessionVariables = {
|
|
||||||
# This is for pushing builds to my local S3 cache
|
|
||||||
AWS_SHARED_CREDENTIALS_FILE = "/run/agenix/cache-credentials";
|
|
||||||
CLICOLOR = 1;
|
|
||||||
EDITOR = "nvim";
|
|
||||||
# vte_new_tab_cwd causes new Terminal tabs to open in the
|
|
||||||
# same CWD as the current tab
|
|
||||||
LESS_TERMCAP_mb = "\\033[01;31m"; # begin blinking
|
|
||||||
LESS_TERMCAP_md = "\\033[01;31m"; # begin bold
|
|
||||||
LESS_TERMCAP_me = "\\033[0m"; # end mode
|
|
||||||
LESS_TERMCAP_so = "\\033[01;44;36m"; # begin standout-mode (bottom of screen)
|
|
||||||
LESS_TERMCAP_se = "\\033[0m"; # end standout-mode
|
|
||||||
LESS_TERMCAP_us = "\\033[00;36m"; # begin underline
|
|
||||||
LESS_TERMCAP_ue = "\\033[0m"; # end underline
|
|
||||||
LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = "1";
|
|
||||||
LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd";
|
|
||||||
MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true";
|
|
||||||
OS_CLOUD = "default";
|
|
||||||
PROMPT = "{vte_new_tab_cwd}{env_name}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {short_cwd}{branch_color}{curr_branch: {}}{RESET} {BOLD_BLUE}{prompt_end}{RESET} ";
|
|
||||||
SWORD_PATH = "${config.home.homeDirectory}/.sword/";
|
|
||||||
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
|
|
||||||
# Tells vox where to find virtualenvs
|
|
||||||
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
|
|
||||||
XONSH_COLOR_STYLE = "default";
|
|
||||||
|
|
||||||
GOPATH = "${config.home.homeDirectory}/src/go";
|
|
||||||
GOBIN = "${config.home.homeDirectory}/src/bin";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
aliases = {
|
xonsh = {
|
||||||
# Python related ones
|
enable = true;
|
||||||
ac = "vox activate";
|
|
||||||
d = "vox deactivate";
|
|
||||||
s = "nix run \".#runserver\"";
|
|
||||||
|
|
||||||
# Nix related ones
|
sessionVariables = {
|
||||||
deploy = "nixos-rebuild switch --use-remote-sudo --use-substitutes --target-host";
|
# This is for pushing builds to my local S3 cache
|
||||||
gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx";
|
AWS_SHARED_CREDENTIALS_FILE = "/run/agenix/cache-credentials";
|
||||||
nb = "nix build -L";
|
CARAPACE_BRIDGES = "zsh,bash";
|
||||||
nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\"";
|
COMPLETIONS_CONFIRM = "True";
|
||||||
nixtest = "nixpkgs-review rev HEAD";
|
CLICOLOR = 1;
|
||||||
nixup = "nix flake lock --update-input";
|
EDITOR = "nvim";
|
||||||
nixcopy = "nix copy --to \"s3://binary-cache/?profile=default&endpoint=nas.home%3A9000&scheme=http\"";
|
# vte_new_tab_cwd causes new Terminal tabs to open in the
|
||||||
stable = "nix flake lock --update-input nixstable --update-input hm --update-input nixvimstable";
|
# same CWD as the current tab
|
||||||
unstable = "nix flake lock --update-input nixunstable --update-input hmunstable --update-input nixvimunstable --update-input nurpkgs --update-input vsext --update-input wsl";
|
LESS_TERMCAP_mb = "\\033[01;31m"; # begin blinking
|
||||||
updateScript = "nix-shell maintainers/scripts/update.nix --argstr package";
|
LESS_TERMCAP_md = "\\033[01;31m"; # begin bold
|
||||||
|
LESS_TERMCAP_me = "\\033[0m"; # end mode
|
||||||
|
LESS_TERMCAP_so = "\\033[01;44;36m"; # begin standout-mode (bottom of screen)
|
||||||
|
LESS_TERMCAP_se = "\\033[0m"; # end standout-mode
|
||||||
|
LESS_TERMCAP_us = "\\033[00;36m"; # begin underline
|
||||||
|
LESS_TERMCAP_ue = "\\033[0m"; # end underline
|
||||||
|
LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN = "1";
|
||||||
|
LSCOLORS = "ExGxBxDxCxEgEdxbxgxcxd";
|
||||||
|
MAVEN_OPTS = " -Dmaven.wagon.http.ssl.insecure=true";
|
||||||
|
OS_CLOUD = "default";
|
||||||
|
PROMPT = "{vte_new_tab_cwd}{env_name}{BOLD_GREEN}{user}@{hostname}{BOLD_BLUE} {short_cwd}{branch_color}{curr_branch: {}}{RESET} {BOLD_BLUE}{prompt_end}{RESET} ";
|
||||||
|
SWORD_PATH = "${config.home.homeDirectory}/.sword/";
|
||||||
|
TIMEFORMAT = "%3Uu %3Ss %3lR %P%%";
|
||||||
|
# Tells vox where to find virtualenvs
|
||||||
|
VIRTUALENV_HOME = "${config.home.homeDirectory}/venv/";
|
||||||
|
XONSH_COLOR_STYLE = "default";
|
||||||
|
|
||||||
# General
|
GOPATH = "${config.home.homeDirectory}/src/go";
|
||||||
gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh";
|
GOBIN = "${config.home.homeDirectory}/src/bin";
|
||||||
k = "kubectl";
|
};
|
||||||
kn = "kubectl get nodes -o wide";
|
|
||||||
kp = "kubectl get pods -o wide";
|
|
||||||
ls = "ls --color";
|
|
||||||
ll = "ls -l --color";
|
|
||||||
win = "sudo virsh start win10";
|
|
||||||
z = "zeditor .";
|
|
||||||
|
|
||||||
# Tailscale related ones
|
aliases = {
|
||||||
tsup = "sudo tailscale up";
|
# Python related ones
|
||||||
tspub = "sudo tailscale up --exit-node=linode";
|
ac = "vox activate";
|
||||||
tshome = "sudo tailscale up --exit-node=2maccabees";
|
d = "vox deactivate";
|
||||||
tsclear = "sudo tailscale up --exit-node=''";
|
s = "nix run \".#runserver\"";
|
||||||
|
|
||||||
# Vagrant related
|
# Nix related ones
|
||||||
vdown = "vagrant destroy";
|
deploy = "nixos-rebuild switch --use-remote-sudo --use-substitutes --target-host";
|
||||||
vhalt = "vagrant halt";
|
gl-nging = "sudo nixos-container run gitlab -- systemctl restart nginx";
|
||||||
vos = "vagrant up --provision --provider openstack";
|
nb = "nix build -L";
|
||||||
vprov = "vagrant provision";
|
nixdu = "sudo nix-store --gc --print-roots | egrep -v r\"^(/nix/var|/run/\\w+-system|\\{memory|/proc)\"";
|
||||||
vup = "vagrant up --provision --provider libvirt";
|
nixtest = "nixpkgs-review rev HEAD";
|
||||||
vssh = "vagrant ssh";
|
nixup = "nix flake lock --update-input";
|
||||||
|
nixcopy = "nix copy --to \"s3://binary-cache/?profile=default&endpoint=nas.home%3A9000&scheme=http\"";
|
||||||
|
stable = "nix flake lock --update-input nixstable --update-input hm --update-input nixvimstable";
|
||||||
|
unstable = "nix flake lock --update-input nixunstable --update-input hmunstable --update-input nixvimunstable --update-input nurpkgs --update-input vsext --update-input wsl";
|
||||||
|
updateScript = "nix-shell maintainers/scripts/update.nix --argstr package";
|
||||||
|
|
||||||
|
# General
|
||||||
|
gh-personal = "$GH_CONFIG_DIR=\"${config.home.homeDirectory}/.config/gh/personal\" gh";
|
||||||
|
k = "kubectl";
|
||||||
|
kn = "kubectl get nodes -o wide";
|
||||||
|
kp = "kubectl get pods -o wide";
|
||||||
|
ls = "ls --color";
|
||||||
|
ll = "ls -l --color";
|
||||||
|
win = "sudo virsh start win10";
|
||||||
|
z = "zeditor .";
|
||||||
|
|
||||||
|
# Tailscale related ones
|
||||||
|
tsup = "sudo tailscale up";
|
||||||
|
tspub = "sudo tailscale up --exit-node=linode";
|
||||||
|
tshome = "sudo tailscale up --exit-node=2maccabees";
|
||||||
|
tsclear = "sudo tailscale up --exit-node=''";
|
||||||
|
|
||||||
|
# Vagrant related
|
||||||
|
vdown = "vagrant destroy";
|
||||||
|
vhalt = "vagrant halt";
|
||||||
|
vos = "vagrant up --provision --provider openstack";
|
||||||
|
vprov = "vagrant provision";
|
||||||
|
vup = "vagrant up --provision --provider libvirt";
|
||||||
|
vssh = "vagrant ssh";
|
||||||
|
};
|
||||||
|
|
||||||
|
configHeader = builtins.readFile ./xonsh_header.xsh;
|
||||||
|
configFooter =
|
||||||
|
(builtins.readFile ./xonsh_footer.xsh)
|
||||||
|
+ (builtins.concatStringsSep "\n" [
|
||||||
|
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
|
||||||
|
" $NIX_LD = fp.read().strip()"
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
configHeader = builtins.readFile ./xonsh_header.xsh;
|
|
||||||
configFooter =
|
|
||||||
(builtins.readFile ./xonsh_footer.xsh)
|
|
||||||
+ (builtins.concatStringsSep "\n" [
|
|
||||||
"with open('${pkgs.stdenv.cc}/nix-support/dynamic-linker', 'r') as fp:"
|
|
||||||
" $NIX_LD = fp.read().strip()"
|
|
||||||
]);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,3 +129,5 @@ import builtins
|
|||||||
builtins.true = True
|
builtins.true = True
|
||||||
builtins.false = False
|
builtins.false = False
|
||||||
builtins.null = None
|
builtins.null = None
|
||||||
|
|
||||||
|
exec($(carapace _carapace xonsh))
|
||||||
|
|||||||
Reference in New Issue
Block a user