aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-09-27 22:16:53 +0200
committerAdrian Kummerlaender2018-09-27 22:16:53 +0200
commitfe31244529c49ced081348b7db66e78eabc809dd (patch)
tree26fb7fc8815a5f743d4ed263a5ab79fbf2fdf251
parent3ea8a40d20a244ca2084a7654f0c3a41de98ea87 (diff)
downloadblog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar.gz
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar.bz2
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar.lz
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar.xz
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.tar.zst
blog.kummerlaender.eu-fe31244529c49ced081348b7db66e78eabc809dd.zip
Use shared Nix derivations of XSLT build stack
-rw-r--r--pkgs/BuildXSLT.nix23
-rw-r--r--pkgs/InputXSLT.nix20
-rw-r--r--pkgs/KaTeX.nix49
-rw-r--r--pkgs/StaticXSLT.nix23
-rw-r--r--pkgs/generate.nix12
-rw-r--r--pkgs/preview.nix10
-rw-r--r--shell.nix30
7 files changed, 16 insertions, 151 deletions
diff --git a/pkgs/BuildXSLT.nix b/pkgs/BuildXSLT.nix
deleted file mode 100644
index 4e5dcb6..0000000
--- a/pkgs/BuildXSLT.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-stdenv.mkDerivation rec {
- name = "BuildXSLT";
-
- src = fetchFromGitHub {
- owner = "KnairdA";
- repo = "BuildXSLT";
- rev = "master";
- sha256 = "09kxhvhzn0r62l39zgj1kc21rb565fnc1y3sg48p4gi4v15xjmc6";
- };
-
- installPhase = ''
- mkdir $out
- cp -r * $out/
- '';
-
- meta = with stdenv.lib; {
- description = "BuildXSLT";
- homepage = https://github.com/KnairdA/BuildXSLT/;
- license = stdenv.lib.licenses.mit;
- };
-}
diff --git a/pkgs/InputXSLT.nix b/pkgs/InputXSLT.nix
deleted file mode 100644
index a85bc37..0000000
--- a/pkgs/InputXSLT.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchFromGitHub, cmake, boost, xalanc, xercesc, discount }:
-
-stdenv.mkDerivation rec {
- name = "InputXSLT";
-
- src = fetchFromGitHub {
- owner = "KnairdA";
- repo = "InputXSLT";
- rev = "master";
- sha256 = "1j9fld3sh1jyscnsx6ab9jn5x6q67rjh9p3bgsh5na1qrs40dql0";
- };
-
- buildInputs = [ cmake boost xalanc xercesc discount ];
-
- meta = with stdenv.lib; {
- description = "InputXSLT";
- homepage = https://github.com/KnairdA/InputXSLT/;
- license = stdenv.lib.licenses.asl20;
- };
-}
diff --git a/pkgs/KaTeX.nix b/pkgs/KaTeX.nix
deleted file mode 100644
index 37fe63a..0000000
--- a/pkgs/KaTeX.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ stdenv, pkgs, ... }:
-
-let
- katex-src = stdenv.mkDerivation rec {
- name = "katex-src";
-
- src = pkgs.fetchzip {
- url = "https://github.com/Khan/KaTeX/releases/download/v0.10.0-alpha/katex.zip";
- sha256 = "002dzyf3wcyjxv4m6vv0v99gf82a9k7rxsnlvf93h9fhcda2vj7l";
- };
-
- buildInputs = [ pkgs.nodejs ];
-
- installPhase = ''
- mkdir -p $out/share/katex
- cp katex.min.js $out/share/katex/
- '';
-
- meta = {
- description = "KaTeX";
- homepage = https://github.com/Khan/KaTeX;
- license = stdenv.lib.licenses.mit;
- platforms = stdenv.lib.platforms.all;
- };
- };
-in pkgs.writeTextFile {
- name = "katex-wrapper";
- executable = true;
- destination = "/bin/katex";
-
- text = ''
- #!${pkgs.nodejs}/bin/node
-
- var katex = require("${katex-src}/share/katex/katex.min.js");
- var input = "";
-
- var args = process.argv.slice(2);
-
- process.stdin.on("data", function(chunk) {
- input += chunk.toString();
- });
-
- process.stdin.on("end", function() {
- var options = { displayMode: args.indexOf("--display-mode") !== -1 };
- var output = katex.renderToString(input, options);
- console.log(output);
- });
- '';
-}
diff --git a/pkgs/StaticXSLT.nix b/pkgs/StaticXSLT.nix
deleted file mode 100644
index 3caee06..0000000
--- a/pkgs/StaticXSLT.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-stdenv.mkDerivation rec {
- name = "StaticXSLT";
-
- src = fetchFromGitHub {
- owner = "KnairdA";
- repo = "StaticXSLT";
- rev = "master";
- sha256 = "17gd181cw9yyc4h1fn7fikcgm8g7fdwm7d7fxwib4aynm18kwqad";
- };
-
- installPhase = ''
- mkdir $out
- cp -r * $out/
- '';
-
- meta = with stdenv.lib; {
- description = "StaticXSLT";
- homepage = https://github.com/KnairdA/StaticXSLT/;
- license = stdenv.lib.licenses.mit;
- };
-}
diff --git a/pkgs/generate.nix b/pkgs/generate.nix
deleted file mode 100644
index 25f1ca1..0000000
--- a/pkgs/generate.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ pkgs, ... }:
-
-let
- InputXSLT = pkgs.callPackage ./InputXSLT.nix {};
- StaticXSLT = pkgs.callPackage ./StaticXSLT.nix {};
- BuildXSLT = pkgs.callPackage ./BuildXSLT.nix {};
-in pkgs.writeScriptBin
- "generate"
- ''
- #!/bin/sh
- ${InputXSLT}/bin/ixslt --input make.xml --transformation ${BuildXSLT}/build.xsl --include ${StaticXSLT}/
- ''
diff --git a/pkgs/preview.nix b/pkgs/preview.nix
deleted file mode 100644
index 352de43..0000000
--- a/pkgs/preview.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ pkgs, ... }:
-
-pkgs.writeScriptBin
- "preview"
- ''
- #!/bin/sh
- pushd target/99_result
- ${pkgs.python3}/bin/python -m http.server 8080
- popd
- ''
diff --git a/shell.nix b/shell.nix
index 714c2bc..719b8df 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,18 +1,20 @@
-with import <nixpkgs> {};
+{ system ? builtins.currentSystem }:
-stdenv.mkDerivation rec {
- name = "blog-env";
- env = buildEnv { name = name; paths = buildInputs; };
+let
+ pkgs = import <nixpkgs> { inherit system; };
+ mypkgs = import (fetchTarball "https://pkgs.kummerlaender.eu/nixexprs.tar.gz") { };
- buildInputs = let
- generate = pkgs.callPackage ./pkgs/generate.nix {};
- preview = pkgs.callPackage ./pkgs/preview.nix {};
- katex = pkgs.callPackage ./pkgs/KaTeX.nix {};
- in [
- generate
- preview
- pandoc
- highlight
- katex
+in pkgs.stdenv.mkDerivation rec {
+ name = "blog.kummerlaender.eu";
+
+ buildInputs = [
+ pkgs.pandoc
+ pkgs.highlight
+ mypkgs.katex-wrapper
+ mypkgs.make-xslt
];
+
+ shellHook = ''
+ export NIX_SHELL_NAME="${name}"
+ '';
}