user/direnv: clear cache on activation
also changed the layout name to be a bit easier to find if need be
This commit is contained in:
parent
b333c10ac6
commit
3a5115c86a
2 changed files with 8 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ...}: {
|
||||
{ config, lib, ... }: {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = {
|
||||
|
|
@ -8,4 +8,9 @@
|
|||
programs.git.extraConfig.core.excludesFile = ".envrc";
|
||||
# We can't use .source since hm manages this file too
|
||||
xdg.configFile."direnv/direnvrc".text = builtins.readFile ../../res/direnvrc;
|
||||
home.activation = {
|
||||
direnvClearCache = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
$DRY_RUN_CMD rm -rf $VERBOSE_ARG $HOME/.cache/direnv/layouts
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,5 +4,7 @@ direnv_layout_dir() {
|
|||
echo "${direnv_layout_dirs[$PWD]:=$(
|
||||
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
||||
echo -n "$PWD" | shasum | cut -d ' ' -f 1
|
||||
echo -n "-"
|
||||
basename $PWD
|
||||
)}"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue