added direnv

This commit is contained in:
Jakub Kropáček 2024-09-27 09:10:23 +02:00
parent 4569937ef2
commit 234a1e2fb8
3 changed files with 13 additions and 1 deletions

View file

@ -1,4 +1,6 @@
# Usefull links # Usefull links
- https://lazamar.co.uk/nix-versions/ - https://lazamar.co.uk/nix-versions/
- https://nix-community.github.io/home-manager/options.xhtml - https://nix-community.github.io/home-manager/options.xhtml
- https://home-manager-options.extranix.com/
- https://search.nixos.org/
- https://discourse.nixos.org/t/why-does-home-manager-also-have-an-option-to-install-user-packages/33982 - https://discourse.nixos.org/t/why-does-home-manager-also-have-an-option-to-install-user-packages/33982

View file

@ -28,7 +28,7 @@ in
enable = true; enable = true;
}; };
users.users.krop = lib.mkIf cfg.addUserToGroup { users.users.krop = lib.mkIf cfg.addUserToGroup {
extraGroups = ["docker"]; extraGroups = [ "docker" ];
}; };
}; };
} }

View file

@ -176,6 +176,16 @@
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
nix-direnv.enable = true; nix-direnv.enable = true;
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" | sha1sum | cut -d ' ' -f 1
)}"
}
'';
}; };
programs.zsh = { programs.zsh = {