qenya/zsh: use direnv to load local dev shells

This commit is contained in:
Katherina Walshe-Grey 2025-02-26 11:07:53 +00:00
parent 8e4b0d26b3
commit 17402985b6
2 changed files with 3 additions and 10 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use_nix

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, ... }:
{
home.packages = with pkgs; [ direnv ];
programs.zsh = {
enable = true;
enableCompletion = true;
@ -26,19 +27,10 @@
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
plugins = [ "git" "sudo" "direnv" ];
theme = "agnoster";
};
initExtra = ''
# If a shell is started in a directory with a shell.nix, automatically run nix-shell
if [ -f ./shell.nix ]; then
if [ -z "$IN_NIX_SHELL" ]; then
nix-shell --command "zsh"
fi
fi
'';
envExtra = ''
DEFAULT_USER=qenya
'';