Skip to content

Commit

Permalink
refactor: add localBin, goBin & rustBin into PATH env
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Sep 16, 2024
1 parent 5895d7c commit 2abea4e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions home/base/core/shells/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{pkgs-unstable, ...}: let
{
config,
pkgs-unstable,
...
}: let
shellAliases = {
k = "kubectl";

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()))'";
};

localBin = "${config.home.homeDirectory}/.local/bin";
goBin = "${config.home.homeDirectory}/go/bin";
rustBin = "${config.home.homeDirectory}/.cargo/bin";
in {
# only works in bash/zsh, not nushell
home.shellAliases = shellAliases;
Expand All @@ -20,7 +28,7 @@ in {
enable = true;
enableCompletion = true;
bashrcExtra = ''
export PATH="$HOME/.local/bin:$HOME/go/bin:$PATH"
export PATH="$PATH:${localBin}:${goBin}:${rustBin}"
'';
};
}
2 changes: 1 addition & 1 deletion home/base/tui/editors/emacs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}:
with lib; let
cfg = config.modules.editors.emacs;
envExtra = ''
envExtra = lib.mkAfter ''
export PATH="${config.xdg.configHome}/emacs/bin:$PATH"
'';
shellAliases = {
Expand Down
6 changes: 3 additions & 3 deletions home/darwin/shell.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let
envExtra = ''
{lib}: let
envExtra = lib.mkAfter ''
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
'';
# copied from the content generated by `conda init bash`
initExtra = ''
initExtra = lib.mkAfter ''
arch=$(uname -m)
if [ "aarch64" = "$arch" ] || [ "arm64" = "$arch" ]; then
Expand Down

0 comments on commit 2abea4e

Please sign in to comment.