mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-11 07:10:39 +02:00
refactor: move impermanence config to application definition where possible
This commit is contained in:
parent
8990a63a1e
commit
69b0166a6b
8 changed files with 62 additions and 54 deletions
22
users/myuser/dev/direnv.nix
Normal file
22
users/myuser/dev/direnv.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
|
||||
# Store layout configs in an XDG directory and not in a .direnv local directory
|
||||
stdlib = ''
|
||||
: ''${XDG_CACHE_HOME:=$HOME/.cache}
|
||||
declare -A direnv_layout_dirs
|
||||
direnv_layout_dir() {
|
||||
echo "''${direnv_layout_dirs[$PWD]:=$(
|
||||
echo -n "$XDG_CACHE_HOME"/direnv/layouts/
|
||||
echo -n "$PWD" | shasum | cut -d ' ' -f 1
|
||||
)}"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
home.persistence."/state".directories = [
|
||||
".local/share/direnv"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue