From 300671d0dd52dc12a144010717581f0a6ba5b124 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 26 Oct 2022 02:08:12 +0200 Subject: flake: add example as a package This allows quickly testing compiling the example gallery with a given version of ldgallery. For example: ```sh nix build github:ldgallery/ldgallery?rev=commithash#example -o result python -m http.server --directory result ``` GitHub: closes #339 --- flake.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/flake.nix b/flake.nix index 99221c7..688601c 100644 --- a/flake.nix +++ b/flake.nix @@ -117,6 +117,19 @@ ]; }; + example = pkgs.stdenv.mkDerivation { + pname = "ldgallery-example"; + version = ldgalleryVersion; + src = ./example; + nativeBuildInputs = [ ldgallery ]; + buildPhase = '' + # Need UTF-8: https://github.com/ldgallery/ldgallery/issues/341 + export LC_ALL=C.UTF-8 + ldgallery --input-dir src --output-dir $out --with-viewer + ''; + installPhase = ":"; + }; + default = ldgallery; }; -- cgit v1.2.3