Make sure direnv flake profiles aren't garbage-collected
This commit is contained in:
parent
048889dc9d
commit
99d476e7b1
1 changed files with 6 additions and 1 deletions
|
@ -18,7 +18,12 @@
|
||||||
use_flake() {
|
use_flake() {
|
||||||
watch_file flake.nix
|
watch_file flake.nix
|
||||||
watch_file flake.lock
|
watch_file flake.lock
|
||||||
eval "$(nix print-dev-env --profile "$(direnv_layout_dir)/flake-profile")"
|
local profile_dir="$(direnv_layout_dir)/flake-profile"
|
||||||
|
eval "$(nix print-dev-env --profile "''${profile_dir}")"
|
||||||
|
local stripped_pwd=''${PWD/\//}
|
||||||
|
local escaped_pwd=''${stripped_pwd//-/--}
|
||||||
|
local escaped_pwd=''${escaped_pwd//\//-}
|
||||||
|
ln -fs "''${profile_dir}" "/nix/var/nix/gcroots/per-user/$USER/''${escaped_pwd}"
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue