add hydra ci
This commit is contained in:
parent
b623e279a5
commit
9291a221b7
31
default.nix
Normal file
31
default.nix
Normal 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
20
release.nix
Normal 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
|
Loading…
Reference in a new issue