mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-24 09:48:30 +02:00
refactor: add localBin, goBin & rustBin into PATH env
This commit is contained in:
@@ -1,10 +1,18 @@
|
|||||||
{pkgs-unstable, ...}: let
|
{
|
||||||
|
config,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
localBin = "${config.home.homeDirectory}/.local/bin";
|
||||||
|
goBin = "${config.home.homeDirectory}/go/bin";
|
||||||
|
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
||||||
in {
|
in {
|
||||||
# only works in bash/zsh, not nushell
|
# only works in bash/zsh, not nushell
|
||||||
home.shellAliases = shellAliases;
|
home.shellAliases = shellAliases;
|
||||||
@@ -20,7 +28,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
bashrcExtra = ''
|
bashrcExtra = ''
|
||||||
export PATH="$HOME/.local/bin:$HOME/go/bin:$PATH"
|
export PATH="$PATH:${localBin}:${goBin}:${rustBin}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
cfg = config.modules.editors.emacs;
|
cfg = config.modules.editors.emacs;
|
||||||
envExtra = ''
|
envExtra = lib.mkAfter ''
|
||||||
export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
|
export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
|
||||||
'';
|
'';
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
let
|
{lib}: let
|
||||||
envExtra = ''
|
envExtra = lib.mkAfter ''
|
||||||
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
||||||
'';
|
'';
|
||||||
# copied from the content generated by `conda init bash`
|
# copied from the content generated by `conda init bash`
|
||||||
initExtra = ''
|
initExtra = lib.mkAfter ''
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
|
|
||||||
if [ "aarch64" = "$arch" ] || [ "arm64" = "$arch" ]; then
|
if [ "aarch64" = "$arch" ] || [ "arm64" = "$arch" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user