This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/ci/woodpecker/server.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2023-04-08 18:11:07 +00:00
{
2023-04-21 13:51:47 +00:00
buildGoApplication,
2023-04-08 18:11:07 +00:00
callPackage,
writeScript,
}: let
woodpecker-frontend = callPackage ./frontend.nix {};
common = callPackage ./common.nix {};
in
2023-04-21 13:51:47 +00:00
buildGoApplication rec {
2023-04-08 18:11:07 +00:00
pname = "woodpecker-server";
inherit (common) version src ldflags postBuild;
2023-04-21 13:51:47 +00:00
modules = ./gomod2nix.toml;
2023-04-08 18:11:07 +00:00
postPatch = ''
cp -r ${woodpecker-frontend} web/dist
'';
subPackages = "cmd/server";
CGO_ENABLED = 1;
2023-04-12 07:12:24 +00:00
patches = [./unlimited-matrix.patch];
2023-04-08 18:11:07 +00:00
passthru = {
inherit woodpecker-frontend;
updateScript = writeScript "update-woodpecker" ''
${../../scripts/update-git.sh} https://github.com/woodpecker-ci/woodpecker ci/woodpecker/source.json
if [ "$(git diff -- ci/woodpecker/source.json)" ]; then
SRC_PATH=$(nix-build -E '(import ./. {}).${pname}.src')
${../../scripts/update-yarn.sh} $SRC_PATH/web ci/woodpecker
2023-04-21 13:51:47 +00:00
${../../scripts/update-go.sh} $SRC_PATH ci/woodpecker/
2023-04-08 18:11:07 +00:00
fi
'';
};
meta =
common.meta
// {
description = "Woodpecker Continuous Integration server";
};
}