Improve nix files

List available versions; refactor modules to reuse default values.
This commit is contained in:
Eike Kettner
2020-01-22 23:11:02 +01:00
parent ec29e44d3d
commit c0f39d6497
5 changed files with 129 additions and 119 deletions

View File

@ -1,6 +1,5 @@
version: {stdenv, fetchzip, file, curl, inotifyTools, fetchurl, jre8_headless, bash}:
cfg: {stdenv, fetchzip, file, curl, inotifyTools, fetchurl, jre8_headless, bash}:
let
# version = "0.2.0";
meta = with stdenv.lib; {
description = "Docspell helps to organize and archive your paper documents.";
homepage = https://github.com/eikek/docspell;
@ -9,12 +8,9 @@ let
};
in
{ server = stdenv.mkDerivation rec {
name = "docspell-server-${version}";
name = "docspell-server-${cfg.version}";
src = fetchzip {
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-restserver-${version}.zip";
sha256 = "1mpyd66pcsd2q4wx9vszldqlamz9qgv6abrxh7xwzw23np61avy5";
};
src = fetchzip cfg.server;
buildInputs = [ jre8_headless ];
@ -34,12 +30,9 @@ in
};
joex = stdenv.mkDerivation rec {
name = "docspell-joex-${version}";
name = "docspell-joex-${cfg.version}";
src = fetchzip {
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-joex-${version}.zip";
sha256 = "1ycfcfcv24vvkdbzvnahj500gb5l9vdls4bxq0jd1zn72p4z765f";
};
src = fetchzip cfg.joex;
buildInputs = [ jre8_headless ];
@ -58,13 +51,10 @@ in
inherit meta;
};
tools = stdenv.mkDerivation rec {
name = "docspell-tools-${version}";
tools = stdenv.mkDerivation {
name = "docspell-tools-${cfg.version}";
src = fetchzip {
url = "https://github.com/eikek/docspell/releases/download/v${version}/docspell-tools-${version}.zip";
sha256 = "0hd93rlnnrq8xj7knp38x1jj2mv4y5lvbcv968bzk5f1az51qsvg";
};
src = fetchzip cfg.tools;
buildPhase = "true";