nixpkgs/pkgs/by-name/ho/homebox/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
1.7 KiB
Nix
Raw Normal View History

2024-06-15 13:09:11 +00:00
{
lib,
buildGo123Module,
2024-06-15 13:09:11 +00:00
fetchFromGitHub,
pnpm,
nodejs,
go_1_23,
2024-06-15 13:09:11 +00:00
git,
cacert,
2024-10-10 15:13:29 +00:00
nixosTests,
2024-06-15 13:09:11 +00:00
}:
let
pname = "homebox";
2024-11-30 12:42:25 +00:00
version = "0.16.0";
2024-06-15 13:09:11 +00:00
src = fetchFromGitHub {
owner = "sysadminsmedia";
repo = "homebox";
rev = "v${version}";
2024-11-30 12:42:25 +00:00
hash = "sha256-d8SQWj7S6G1ZemMH6QL9QZuPQfxNRcfCurPaTnS0Iyo=";
2024-06-15 13:09:11 +00:00
};
in
buildGo123Module {
2024-06-15 13:09:11 +00:00
inherit pname version src;
vendorHash = "sha256-Ftm5tR3w8S3mjYLJG0+17nYP5kDbaAd8QkbZpNt7WuE=";
2024-06-15 13:09:11 +00:00
modRoot = "backend";
# the goModules derivation inherits our buildInputs and buildPhases
# Since we do pnpm thing in those it fails if we don't explicitely remove them
overrideModAttrs = _: {
nativeBuildInputs = [
go_1_23
2024-06-15 13:09:11 +00:00
git
cacert
];
preBuild = "";
};
pnpmDeps = pnpm.fetchDeps {
inherit pname version;
src = "${src}/frontend";
2024-11-30 12:42:25 +00:00
hash = "sha256-x7sWSH84UJEXNRLCgEgXc4NrTRsn6OplANi+XGtIN9Y=";
2024-06-15 13:09:11 +00:00
};
pnpmRoot = "../frontend";
env.NUXT_TELEMETRY_DISABLED = 1;
preBuild = ''
pushd ../frontend
pnpm build
popd
mkdir -p ./app/api/static/public
cp -r ../frontend/.output/public/* ./app/api/static/public
'';
nativeBuildInputs = [
pnpm
pnpm.configHook
nodejs
];
CGO_ENABLED = 0;
GOOS = "linux";
doCheck = false;
ldflags = [
"-s"
"-w"
"-extldflags=-static"
"-X main.version=${version}"
"-X main.commit=${version}"
];
2024-10-10 15:13:29 +00:00
passthru = {
tests = {
inherit (nixosTests) homebox;
};
};
2024-06-15 13:09:11 +00:00
meta = {
mainProgram = "api";
homepage = "https://homebox.software/";
2024-06-15 13:09:11 +00:00
description = "Inventory and organization system built for the Home User";
maintainers = with lib.maintainers; [ patrickdag ];
license = lib.licenses.agpl3Only;
platforms = lib.platforms.linux;
};
}