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

View file

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

View file

@ -2,5 +2,5 @@
set -x LS_COLORS "$(vivid generate catppuccin-frappe)" set -x LS_COLORS "$(vivid generate catppuccin-frappe)"
# nix path patches # nix path patches
fish_add_path /run/current-system/sw/bin set -p PATH /run/current-system/sw/bin
fish_add_path "/etc/profiles/per-user/$USER/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 fnm env --use-on-cd | source
# cargo # cargo
fish_add_path "$HOME/.cargo/bin" set -p PATH "$HOME/.cargo/bin"
# deno # deno
fish_add_path "$HOME/.deno/bin" set -p PATH "$HOME/.deno/bin"
# pnpm # pnpm
set -x PNPM_HOME "$HOME/Library/pnpm" set -x PNPM_HOME "$HOME/Library/pnpm"
@ -19,9 +19,9 @@ set -x PNPM_HOME "$HOME/Library/pnpm"
set -x DIRENV_LOG_FORMAT "" set -x DIRENV_LOG_FORMAT ""
# docker # docker
fish_add_path "$HOME/.docker/bin" set -p PATH "$HOME/.docker/bin"
# local bin # local bin
fish_add_path "$HOME/.local/bin" set -p PATH "$HOME/.local/bin"
# fish # fish
set fish_greeting set fish_greeting

View file

@ -12,7 +12,7 @@
system.activationScripts.extraActivation = { system.activationScripts.extraActivation = {
text = '' text = ''
set -eo pipefail 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; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
ctpModule = inputs.catppuccin.homeManagerModules.catppuccin; inherit inputs;
amDiscordModule = inputs.am.homeManagerModules.default;
}; };
users.ryanccn = import ./home; users.ryanccn = import ./home;