Add nix shell aliases

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-12-29 11:25:33 +02:00
parent 20c39024e5
commit 6d913c2ff0
6 changed files with 59 additions and 14 deletions

View File

@@ -5,11 +5,29 @@
{ inputs, ... }:
{
home-manager.users.${user} = {
programs.direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
enableZshIntegration = true;
programs = {
direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
enableZshIntegration = true;
};
zsh = {
shellAliases.nde = "nix-direnv";
initExtra = ''
nix-direnv() {
if [ -z "$1" ]; then
echo "Usage: nix-direnv <shell>"
return 1
fi
echo "use $1" > .envrc
direnv allow
}
'';
};
};
# https://github.com/direnv/direnv/wiki/Customizing-cache-location