add hydra ci

This commit is contained in:
Milan Pässler 2020-02-19 23:15:44 +01:00
parent b623e279a5
commit 9291a221b7
2 changed files with 51 additions and 0 deletions

31
default.nix Normal file
View File

@ -0,0 +1,31 @@
{
pkgs ? import <nixpkgs> {}
, src ? ./.
}:
with pkgs;
stdenv.mkDerivation {
pname = "oeffisearch";
version = "0.1.0";
inherit src;
nativeBuildInputs = [ nim ];
buildInputs = [ openssl ];
buildPhase = ''
runHook preBuild
nim c -d:release --nimcache:$PWD src/oeffisearch.nim
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 src/oeffisearch $out/bin/oeffisearch
mkdir -p $out/share
cp -r client $out/share/client
runHook postInstall
'';
fixupPhase = ''
runHook preFixup
patchelf --set-rpath ${lib.makeLibraryPath [ openssl ]} $out/bin/oeffisearch
runHook postFixup
'';
}

20
release.nix Normal file
View File

@ -0,0 +1,20 @@
{ oeffisearchSrc ? { outPath = ./.; revCount = 1234; shortRev = "abcdef"; }
, nixpkgs ? builtins.fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz
, officialRelease ? false
}:
let
pkgs = import nixpkgs { system = builtins.currentSystem or "x86_64-linux"; };
jobs = rec {
build.x86_64-linux = pkgs.releaseTools.nixBuild (
(import ./default.nix { inherit pkgs; })
.drvAttrs // {
postHook = ''
src=$origSrc
'';
}
);
};
in jobs