Files
nixpkgs/pkgs/by-name/ho/homebox/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

106 lines
1.9 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
pnpm_9,
nodejs,
go_1_24,
git,
cacert,
nixosTests,
}:
let
pname = "homebox";
version = "0.21.0";
src = fetchFromGitHub {
owner = "sysadminsmedia";
repo = "homebox";
tag = "v${version}";
hash = "sha256-JA0LawQHWLCJQno1GsajVSsLG3GGgDp2ttIa2xELX48=";
};
in
buildGoModule {
inherit pname version src;
vendorHash = "sha256-fklNsQEqAjbiaAwTAh5H3eeANkNRDVRuJZ8ithJsfZs=";
modRoot = "backend";
# the goModules derivation inherits our buildInputs and buildPhases
# Since we do pnpm thing in those it fails if we don't explicitly remove them
overrideModAttrs = _: {
nativeBuildInputs = [
go_1_24
git
cacert
];
preBuild = "";
};
pnpmDeps = pnpm_9.fetchDeps {
inherit pname version;
src = "${src}/frontend";
fetcherVersion = 1;
hash = "sha256-gHx4HydL33i1SqzG1PChnlWdlO5NFa5F/R5Yq3mS4ng=";
};
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_9
pnpm_9.configHook
nodejs
];
env.CGO_ENABLED = 0;
doCheck = false;
tags = [
"nodynamic"
];
ldflags = [
"-s"
"-w"
"-extldflags=-static"
"-X main.version=${src.tag}"
"-X main.commit=${src.tag}"
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r $GOPATH/bin/api $out/bin/
runHook postInstall
'';
passthru = {
tests = {
inherit (nixosTests) homebox;
};
};
meta = {
mainProgram = "api";
homepage = "https://homebox.software/";
description = "Inventory and organization system built for the Home User";
maintainers = with lib.maintainers; [
patrickdag
tebriel
];
license = lib.licenses.agpl3Only;
platforms = lib.platforms.linux;
};
}