summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2021-09-28 21:54:18 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2021-10-13 19:43:07 +0100
commit15a4c40852cca4693c8b3b483bc0280efb03cd42 (patch)
tree4f1b974e5ec7140ceedc0ae29e49e255cf1a5df5 /flake.nix
parent59375983ef9a7f69d7a1e4250da5babee9c302c7 (diff)
downloadsubplot-15a4c40852cca4693c8b3b483bc0280efb03cd42.tar.gz
direnv: Add basic flake and direnv setup
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..c19f3bc
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,37 @@
+# This is a nix "flake" which is used both by `direnv` and to offer
+# a quick way to acquire `subplot` in a nix/nixos environment.
+# If you have `direnv` support, just allow this tree and you should
+# be able to develop `subplot`. If you use this as a package flake
+# then the `subplot` package derivation is available in the usual way
+
+{
+ inputs = { flake-utils.url = "github:numtide/flake-utils"; };
+
+ outputs = { self, nixpkgs, flake-utils }:
+ flake-utils.lib.eachDefaultSystem (system:
+ let
+ pkgs = nixpkgs.legacyPackages.${system};
+ test-python-packages = python-packages:
+ with python-packages;
+ [ requests ];
+
+ in {
+ devShell = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ stdenv
+ graphviz
+ plantuml
+ pandoc
+ texlive.combined.scheme-medium
+ daemonize
+ librsvg
+ (python3.withPackages test-python-packages)
+ ];
+ shellHook = ''
+ export SUBPLOT_DOT_PATH=${pkgs.graphviz}/bin/dot
+ export SUBPLOT_JAVA_PATH=${pkgs.jre}/bin/java
+ export SUBPLOT_PLANTUML_JAR_PATH=${pkgs.plantuml}/lib/plantuml.jar
+ '';
+ };
+ });
+}