Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion home-manager/modules/cargo-globals/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ in
{
# Install cargo global packages from Cargo.toml using home-manager activation
home.activation.installCargoGlobals = config.lib.dag.entryAfter [ "writeBoundary" ] ''
export PATH=${pkgs.rustup}/bin:${pkgs.cargo}/bin:${pkgs.dasel}/bin:${pkgs.jq}/bin:${pkgs.gcc}/bin:${pkgs.pkg-config}/bin:$PATH
export PATH=${pkgs.rustup}/bin:${pkgs.cargo}/bin:${pkgs.rustc}/bin:${pkgs.dasel}/bin:${pkgs.jq}/bin:${pkgs.gcc}/bin:${pkgs.pkg-config}/bin:$PATH
export CARGO_HOME="$HOME/.cargo"
Comment on lines +18 to 19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since you're using rustup to manage toolchains, it's better to rely on it to provide the correct cargo and rustc binaries via its shims in $CARGO_HOME/bin. Explicitly adding ${pkgs.cargo}/bin and ${pkgs.rustc}/bin to the PATH can lead to conflicts between the nix-provided packages and the rustup-managed toolchain.

I suggest defining CARGO_HOME first and then adding its bin directory to the PATH, removing the direct dependencies on pkgs.cargo and pkgs.rustc from the PATH for this activation script.

    export CARGO_HOME="$HOME/.cargo"
    export PATH="$CARGO_HOME/bin:${pkgs.rustup}/bin:${pkgs.dasel}/bin:${pkgs.jq}/bin:${pkgs.gcc}/bin:${pkgs.pkg-config}/bin:$PATH

$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup toolchain install stable
$DRY_RUN_CMD ${pkgs.rustup}/bin/rustup default stable
export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig${libiconvPkgConfigPath}''${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
Comment on lines +18 to 22

Copilot AI Feb 7, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The activation script installs/sets a rustup toolchain (rustup toolchain install stable / rustup default stable), but the subsequent installs are performed with ${pkgs.cargo}/bin/cargo + ${pkgs.rustc}/bin/rustc from the PATH. That means these rustup commands don’t actually ensure the toolchain used for cargo install, while still introducing network/stateful side effects and a potential home-manager switch failure when offline.

Consider either (a) removing the rustup toolchain/default steps, or (b) explicitly running cargo via rustup (e.g., rustup run stable cargo … / setting RUSTUP_TOOLCHAIN=stable) and guarding the toolchain install so it’s idempotent and doesn’t hard-fail when the toolchain can’t be fetched.

Copilot uses AI. Check for mistakes.
export OPENSSL_DIR="${pkgs.openssl.dev}"
export OPENSSL_LIB_DIR="${pkgs.openssl.out}/lib"
Expand Down
4 changes: 4 additions & 0 deletions home-manager/modules/npm-globals/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
$DRY_RUN_CMD ${pkgs.bash}/bin/bash ${./install-npm-globals.sh}
'';

home.sessionVariables = {
BUN_INSTALL = "$HOME/.bun";
};

# Add local and bun bins to PATH
home.sessionPath = [
"$HOME/.local/bin"
Expand Down
4 changes: 3 additions & 1 deletion home-manager/programs/bash/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH"

# Worktrunk shell init
eval "$(wt config shell init bash)"
if command -v wt >/dev/null 2>&1; then
eval "$(wt config shell init bash)"
fi
'';

profileExtra = ''
Expand Down
7 changes: 4 additions & 3 deletions home-manager/programs/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
set -gx GOPATH $HOME/go

direnv hook fish | source

# Worktrunk shell init
wt config shell init fish | source
'';
loginShellInit = ''
if test -f /opt/homebrew/bin/brew
Expand Down Expand Up @@ -61,6 +58,10 @@
fish_add_path -p /opt/homebrew/bin
fish_add_path -p /opt/homebrew/opt/postgresql@18/bin
fish_add_path -p /etc/profiles/per-user/${config.home.username}/bin
# Worktrunk shell init
if type -q wt
wt config shell init fish | source
end
set -a fish_complete_path ~/.nix-profile/share/fish/completions/ ~/.nix-profile/share/fish/vendor_completions.d/
set -x FISH_HISTFILE fish
fish_vi_key_bindings
Expand Down
4 changes: 3 additions & 1 deletion home-manager/programs/zsh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
export FNM_VERSION_FILE_STRATEGY="local"

# Worktrunk shell init
eval "$(wt config shell init zsh)"
if command -v wt >/dev/null 2>&1; then
eval "$(wt config shell init zsh)"
fi
'';
};
}
Loading