41 lines
1.2 KiB
Nix
41 lines
1.2 KiB
Nix
|
with import <nixpkgs> {};
|
||
|
let
|
||
|
version = "0.15.1";
|
||
|
src = fetchFromGitHub {
|
||
|
owner = "woodpecker-ci";
|
||
|
repo = "woodpecker";
|
||
|
rev = "v${version}";
|
||
|
sha256 = "ilywzKczcER7kO19X6vhn28HieeT7ZTSsoKyu802bS0=";
|
||
|
};
|
||
|
frontend = mkYarnPackage {
|
||
|
pname = "woodpecker-frontend";
|
||
|
inherit version;
|
||
|
src = "${src}/web";
|
||
|
packageJSON = "${src}/web/package.json";
|
||
|
yarnLock = "${src}/web/yarn.lock";
|
||
|
buildPhase = ''
|
||
|
yarn build
|
||
|
'';
|
||
|
distPhase = "true";
|
||
|
};
|
||
|
meta = with lib; {
|
||
|
description = "Woodpecker is a community fork of the Drone CI system.";
|
||
|
homepage = "https://woodpecker-ci.org";
|
||
|
license = licenses.asl20;
|
||
|
maintainers = with maintainers; [ f0x codedotjs ];
|
||
|
platforms = platforms.linux ++ platforms.darwin;
|
||
|
};
|
||
|
in buildGoModule rec {
|
||
|
pname = "woodpecker-server";
|
||
|
inherit version;
|
||
|
inherit src;
|
||
|
vendorSha256 = null;
|
||
|
subPackages = [ "cmd/server" ];
|
||
|
buildInputs = [pkgs.glibc.static];
|
||
|
CGO_ENABLED = true;
|
||
|
cflags="-I${pkgs.glibc.dev}/include";
|
||
|
ldflags = ["-s" "-w" ''-extldflags "-static"'' "-X github.com/woodpecker-ci/woodpecker/version.Version=${version}" "-L ${pkgs.glibc}/lib"];
|
||
|
postPatch = ''
|
||
|
cp -r ${frontend}/libexec/woodpecker-ci/deps/woodpecker-ci/dist web/dist
|
||
|
'';
|
||
|
}
|