From 7e8fc3c86fd85e388fb8f5e683e6e9c820ea3e37 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.uk>
Date: Mon, 14 Aug 2023 17:49:20 +0100
Subject: [PATCH] feat(home-manager): add local directories to PATH

This adds local `vendor/bin` and `node_modules/.bin` directories to my
`PATH` so I can more quickly and easily run binaries within a project
from within those directories without needing to include the path.
---
 system/nixos/home-manager.nix |  1 +
 system/wsl2/default.nix       | 17 +++++++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/system/nixos/home-manager.nix b/system/nixos/home-manager.nix
index 0cce0066..b39ad828 100644
--- a/system/nixos/home-manager.nix
+++ b/system/nixos/home-manager.nix
@@ -29,6 +29,7 @@ in
     LANG = "en_GB.UTF-8";
     LC_ALL = "en_GB.UTF-8";
     LC_CTYPE = "en_GB.UTF-8";
+    PATH = "$PATH:./vendor/bin:./node_modules/.bin";
     PULUMI_SKIP_UPDATE_CHECK = "true";
     RIPGREP_CONFIG_PATH = "$HOME/.config/ripgrep/config";
   };
diff --git a/system/wsl2/default.nix b/system/wsl2/default.nix
index 0122404a..a2739601 100644
--- a/system/wsl2/default.nix
+++ b/system/wsl2/default.nix
@@ -10,7 +10,20 @@ inputs.home-manager.lib.homeManagerConfiguration {
   inherit pkgs;
 
   modules = [
-    { imports = [ shared-config ]; }
-    { home.packages = shared-packages; }
+    {
+      imports = [ shared-config ];
+
+      home.packages = shared-packages;
+
+      home.sessionVariables = {
+        EDITOR = "nvim";
+        # LANG = "en_GB.UTF-8";
+        # LC_ALL = "en_GB.UTF-8";
+        # LC_CTYPE = "en_GB.UTF-8";
+        PATH = "$PATH:./vendor/bin:./node_modules/.bin";
+        PULUMI_SKIP_UPDATE_CHECK = "true";
+        RIPGREP_CONFIG_PATH = "$HOME/.config/ripgrep/config";
+      };
+    }
   ];
 }