From 5e0acd4eee9b6381b24c9cb14945bbe39cc84c51 Mon Sep 17 00:00:00 2001
From: Jens Nolte <jens@nightmarestudio.de>
Date: Thu, 5 Dec 2019 01:57:45 +0100
Subject: [PATCH] Add direnv on workstations to primary user

---
 nixos/layers/workstation.nix | 5 +++++
 nixos/layers/zsh.nix         | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/nixos/layers/workstation.nix b/nixos/layers/workstation.nix
index 42b6cc1..d19a8cd 100644
--- a/nixos/layers/workstation.nix
+++ b/nixos/layers/workstation.nix
@@ -12,5 +12,10 @@
     spotify
     gimp
   ];
+
+  users.users.jens = {
+    packages = with pkgs; [ direnv ];
+  };
+
 }
 
diff --git a/nixos/layers/zsh.nix b/nixos/layers/zsh.nix
index 979adc4..5ff7766 100644
--- a/nixos/layers/zsh.nix
+++ b/nixos/layers/zsh.nix
@@ -78,6 +78,11 @@ then
 	alias icat="kitty +kitten icat"
 fi
 
+if (( $+commands[direnv] ))
+then
+  eval "$(direnv hook zsh)"
+fi
+
 # "The time the shell waits, in hundredths of seconds, for another key to be pressed when reading bound multi-character sequences."
 # This is for vim-style multi-letter commands (<f><d> is mapped to <Esc>)
 KEYTIMEOUT=10
-- 
GitLab