1
0
Fork 0
mirror of https://github.com/ryanccn/flake.git synced 2025-12-06 08:10:43 +01:00

fix(fish): use set -p PATH instead of fish_add_path

The reasoning for this is that `fish_add_path` writes to a universal variable that is persisted independently of fish configuration files, and this can result in stale `fish_user_paths` entries when calls to `fish_add_path` are removed from the configuration. Using `set -p PATH` ensures that only the environment is written to.
This commit is contained in:
Ryan Cao 2023-09-15 08:46:22 +08:00
parent eb4cb1c367
commit da2644ae42
Signed by: ryanccn
SSH key fingerprint: SHA256:NtP/BlVhoQq4xU6BEcZeT8nIPvHntkJ3lIc2yB+F09E
5 changed files with 23 additions and 25 deletions

24
flake.lock generated
View file

@ -127,11 +127,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1694586081,
"narHash": "sha256-DNAohcMcTJNiFJ2hTTS6R+yaqVU+QVzp1uRsz0Ctiac=",
"lastModified": 1694672497,
"narHash": "sha256-vOW9rupO3zxmRMXNx4K2TXNP8BN3/7rcE4NVQjzw0UI=",
"owner": "nix-community",
"repo": "fenix",
"rev": "b16b1f21654b9490c662f6fd0a8fe3774a4b1606",
"rev": "6cfe8bcc4995a58e04159c301a1d90f3e8582aa1",
"type": "github"
},
"original": {
@ -208,11 +208,11 @@
]
},
"locked": {
"lastModified": 1694585439,
"narHash": "sha256-70BlfEsdURx5f8sioj8JuM+R4/SZFyE8UYrULMknxlI=",
"lastModified": 1694643239,
"narHash": "sha256-pv2k/5FvyirDE8g4TNehzwZ0T4UOMMmqWSQnM/luRtE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a0ddf43b6268f1717afcda54133dea30435eb178",
"rev": "d9b88b43524db1591fb3d9410a21428198d75d49",
"type": "github"
},
"original": {
@ -338,11 +338,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1694553088,
"narHash": "sha256-vnPa/OueHI+Dx7NKB34f5SI7Mmz/VSrP+IAoGNKueU0=",
"lastModified": 1694635326,
"narHash": "sha256-oYA1HZCoxHS1i5qMja1j/kx/UjShCqzQMB6Z3nIHOaI=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "15e13561499dbe90ef07cf37a90c1cedafc53e28",
"rev": "089ae47ebe58faf749b952f5d064078c74ea1e29",
"type": "github"
},
"original": {
@ -362,11 +362,11 @@
]
},
"locked": {
"lastModified": 1694571081,
"narHash": "sha256-VRA+gxhe4aciWTQ5uCKVY2ubOclk18h2aRlLzPbLqMw=",
"lastModified": 1694657451,
"narHash": "sha256-cRZa9ZmUi0EFKcmzpsOXLVhiMQD8XLrku8v+U1YiGm8=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "0282ed291f0e25f30770df5d3f1ca33908ce44a4",
"rev": "7c4f46f0b3597e3c4663285e6794194e55574879",
"type": "github"
},
"original": {

View file

@ -1,14 +1,13 @@
{
config,
ctpModule,
amDiscordModule,
inputs,
...
}: {
home.stateVersion = "23.05";
imports = [
ctpModule
amDiscordModule
inputs.catppuccin.homeManagerModules.catppuccin
inputs.am.homeManagerModules.default
./variables.nix
./fonts.nix

View file

@ -2,5 +2,5 @@
set -x LS_COLORS "$(vivid generate catppuccin-frappe)"
# nix path patches
fish_add_path /run/current-system/sw/bin
fish_add_path "/etc/profiles/per-user/$USER/bin"
set -p PATH /run/current-system/sw/bin
set -p PATH "/etc/profiles/per-user/$USER/bin"

View file

@ -8,9 +8,9 @@ set -x SSH_AUTH_SOCK "$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/
fnm env --use-on-cd | source
# cargo
fish_add_path "$HOME/.cargo/bin"
set -p PATH "$HOME/.cargo/bin"
# deno
fish_add_path "$HOME/.deno/bin"
set -p PATH "$HOME/.deno/bin"
# pnpm
set -x PNPM_HOME "$HOME/Library/pnpm"
@ -19,9 +19,9 @@ set -x PNPM_HOME "$HOME/Library/pnpm"
set -x DIRENV_LOG_FORMAT ""
# docker
fish_add_path "$HOME/.docker/bin"
set -p PATH "$HOME/.docker/bin"
# local bin
fish_add_path "$HOME/.local/bin"
set -p PATH "$HOME/.local/bin"
# fish
set fish_greeting

View file

@ -12,7 +12,7 @@
system.activationScripts.extraActivation = {
text = ''
set -eo pipefail
HOME="/var/root" ${pkgs.lib.getExe' pkgs.nvd "nvd"} --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
HOME="/var/root" ${pkgs.lib.getExe pkgs.nvd} --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
'';
};
@ -36,8 +36,7 @@
useUserPackages = true;
extraSpecialArgs = {
ctpModule = inputs.catppuccin.homeManagerModules.catppuccin;
amDiscordModule = inputs.am.homeManagerModules.default;
inherit inputs;
};
users.ryanccn = import ./home;