From 15a4c40852cca4693c8b3b483bc0280efb03cd42 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 28 Sep 2021 21:54:18 +0100 Subject: direnv: Add basic flake and direnv setup Signed-off-by: Daniel Silverstone --- .envrc | 1 + flake.lock | 40 ++++++++++++++++++++++++++++++++++++++++ flake.nix | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..38de242 --- /dev/null +++ b/flake.lock @@ -0,0 +1,40 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1632639184, + "narHash": "sha256-fRLxre+gPxIkjFVj17O68pyAWU1cxT20XFOiulIWzRw=", + "path": "/nix/store/mz8vpyg587llb4c802w96m956icc39vm-source", + "rev": "fd8a7fd07da0f3fc0e27575891f45c2f88e5dd44", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} 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 + ''; + }; + }); +} -- cgit v1.2.1