about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.envrc8
-rw-r--r--monzo_ynab/.envrc5
-rw-r--r--monzo_ynab/shell.nix9
-rw-r--r--shell.nix14
4 files changed, 29 insertions, 7 deletions
diff --git a/.envrc b/.envrc
index 1e44420ed401..051d09d292a8 100644
--- a/.envrc
+++ b/.envrc
@@ -1,7 +1 @@
-export BRIEFCASE=~/briefcase
-export DEPOT=~/depot
-export NIXPKGS=$HOME/nixpkgs
-export DESKTOP=zeno.lon.corp.google.com
-export LAPTOP=seneca
-export CLOUDTOP=wpcarro.c.googlers.com
-NIX_PATH=nixpkgs=$NIXPKGS:depot=$DEPOT:briefcase=$BRIEFCASE
+eval "$(lorri direnv)"
diff --git a/monzo_ynab/.envrc b/monzo_ynab/.envrc
index 265077343800..121cc134de18 100644
--- a/monzo_ynab/.envrc
+++ b/monzo_ynab/.envrc
@@ -1,5 +1,10 @@
 # source_up traversing up directories until it finds the nearest .envrc file,
 # which it uses to extend the environment in this .envrc.
+#
+# Since ../.envrc calls `eval "$(lorri direnv)"`, the buildInputs and variables
+# definitions inside of the attribute set passed to pkgs.mkShell become
+# available here as well.
 source_up
 export client_id="$(pass show finance/monzo/client-id)"
 export client_secret="$(pass show finance/monzo/client-secret)"
+eval "$(lorri direnv)"
diff --git a/monzo_ynab/shell.nix b/monzo_ynab/shell.nix
new file mode 100644
index 000000000000..836718d85f29
--- /dev/null
+++ b/monzo_ynab/shell.nix
@@ -0,0 +1,9 @@
+{ pkgs ? import <nixpkgs> {}, ... }:
+
+pkgs.mkShell {
+  buildInputs = [
+    pkgs.go
+    pkgs.goimports
+    pkgs.godef
+  ];
+}
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 000000000000..ef8960b822db
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,14 @@
+{ pkgs ? import <nixpkgs> {}, ... }:
+
+pkgs.mkShell rec {
+  buildInputs = [];
+  # TODO(wpcarro): How does pkgs.mkShell handle exported and non-exported
+  # variable definitions?
+  BRIEFCASE = builtins.toPath ~/briefcase;
+  DEPOT = builtins.toPath ~/depot;
+  NIXPKGS = builtins.toPath ~/nixpkgs;
+  NIX_PATH="nixpkgs=${NIXPKGS}:depot=${DEPOT}:briefcase=${BRIEFCASE}";
+  DESKTOP = "zeno.lon.corp.google.com";
+  LAPTOP = "seneca";
+  CLOUDTOP = "wpcarro.c.googlers.com";
+}