refactor: use home.sessionPath instead of hardcoded PATH
- Replace hardcoded PATH with home.sessionPath for proper ordering
- Use ${config.home.homeDirectory} and ${config.home.username} for portability
- Add PNPM_HOME for pnpm global packages
- Remove hardcoded node version path (install pi via pnpm i -g)
This commit is contained in:
parent
03f3a2c156
commit
723b0112a3
1 changed files with 35 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./cli.nix
|
||||
|
|
@ -12,11 +12,43 @@
|
|||
|
||||
home.stateVersion = "24.11";
|
||||
|
||||
# PATH через sessionPath — nix сам собирает в правильном порядке
|
||||
home.sessionPath = [
|
||||
# macOS Homebrew (ARM и Intel)
|
||||
"/opt/homebrew/bin"
|
||||
"/usr/local/bin"
|
||||
|
||||
# System
|
||||
"/usr/bin"
|
||||
"/bin"
|
||||
"/sbin"
|
||||
"/usr/sbin"
|
||||
|
||||
# Nix (darwin-rebuild, nix и т.д.)
|
||||
"/run/current-system/sw/bin"
|
||||
"/nix/var/nix/profiles/default/bin"
|
||||
|
||||
# User nix profile
|
||||
"${config.home.homeDirectory}/.nix-profile/bin"
|
||||
"/etc/profiles/per-user/${config.home.username}/bin"
|
||||
|
||||
# User binaries
|
||||
"${config.home.homeDirectory}/bin"
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
|
||||
# npm/pnpm global — установи pi через: pnpm i -g @mariozechner/pi-coding-agent
|
||||
"${config.home.homeDirectory}/.npm-global/bin"
|
||||
"${config.home.homeDirectory}/.local/share/pnpm"
|
||||
|
||||
# opencode (если установлен)
|
||||
"${config.home.homeDirectory}/.opencode/bin"
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
SEARXNG_URL = "https://search.iscg.dev";
|
||||
# NOTE: include /run/current-system/sw/bin for darwin-rebuild, /nix/var/nix/profiles/default/bin for nix
|
||||
PATH = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/etc/profiles/per-user/mikl/bin:$HOME/.nix-profile/bin:$HOME/bin:$HOME/.local/bin:$HOME/.npm-global/bin:/Users/mikl/.opencode/bin:/Users/mikl/.local/share/pi-node/node-v22.23.1-darwin-arm64/bin";
|
||||
EDITOR = "micro";
|
||||
VISUAL = "micro";
|
||||
# PNPM_HOME для глобальных пакетов
|
||||
PNPM_HOME = "${config.home.homeDirectory}/.local/share/pnpm";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue