about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-14T13·17+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-20T10·26+0100
commit56b503c573317532ef250a47fb075fd699c35ead (patch)
tree673c2a5d4dfef43095b682789185080d0c928d2b
parentb984a2d1e079e0463e0bc00af151612c0e5b0345 (diff)
Prefer direnv's use_nix to shell.nix
I find it bothersome to share the list of Haskell dependencies between my
default.nix and shell.nix files. A few days ago, I created a THIRD file,
shared.nix, that defined the shared code b/w default.nix and shell.nix. This
DRY'd things up, but it also added a new file, which I didn't like.

Today I learned that direnv integrates with Nix using a function called
`use_nix`. Voila! I typically already have .envrc files per-project, so this
doesn't add any unnecessary files, and it allows me to delete my shell.nix
files.

I would use `lorri`, except that I encountered issues using Lorri on my work
computer, which I'm not interested in attempting to resolve now.
-rw-r--r--zoo/.envrc1
-rw-r--r--zoo/shell.nix10
2 files changed, 1 insertions, 10 deletions
diff --git a/zoo/.envrc b/zoo/.envrc
new file mode 100644
index 000000000000..4a4726a5c73f
--- /dev/null
+++ b/zoo/.envrc
@@ -0,0 +1 @@
+use_nix
diff --git a/zoo/shell.nix b/zoo/shell.nix
deleted file mode 100644
index 465f0b05c1ba..000000000000
--- a/zoo/shell.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-let
-  briefcase = import /home/wpcarro/briefcase {};
-in briefcase.buildHaskell.shell {
-  deps = hpkgs: with hpkgs; [
-    hspec
-    rio
-    string-conversions
-    servant-server
-  ];
-}