From 00994a2daf7557737538a4cee6e8cff4958aecfe Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Thu, 4 Jun 2020 10:09:58 -0400
Subject: [PATCH] Advise use of nix-shell and hide the particulars

---
 README.rst |  4 ++--
 shell.nix  | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)
 create mode 100644 shell.nix

diff --git a/README.rst b/README.rst
index 7bd9f0fc..74ee0105 100644
--- a/README.rst
+++ b/README.rst
@@ -8,9 +8,9 @@ Building
 
 The build system uses `Nix`_ which must be installed before anything can be built.
 Builds are tested against a particular nixpkgs revision.
-Start by exporting ``NIX_PATH`` to ensure you use the same revision::
+Start by setting up the development/operations environment::
 
-  $ export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/$(cat nixpkgs.rev).tar.gz
+  $ nix-shell
 
 Documentation
 ~~~~~~~~~~~~~
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 00000000..c9773565
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,18 @@
+{ pkgs ? import <nixpkgs> { } }:
+let
+  nixpkgs-rev = builtins.readFile ./nixpkgs.rev;
+  morph-src = pkgs.fetchFromGitHub {
+    owner = "DBCDK";
+    repo = "morph";
+    rev = "v1.4.0";
+    hash = "sha256:1y6clzi8sfnrv4an26b44r24nnxds1kj9aw3lmjbgxl9yrxxsj1k";
+  };
+  morph = pkgs.callPackage (morph-src + "/nix-packaging") { };
+in
+pkgs.mkShell {
+  NIX_PATH = "nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/${nixpkgs-rev}.tar.gz";
+
+  buildInputs = [
+    morph
+  ];
+}
-- 
GitLab