nidus-sync/default.nix

57 lines
1.3 KiB
Nix
Raw Normal View History

2026-03-04 03:41:41 +00:00
{ pkgs ? import <nixpkgs> { }, proj ? pkgs.proj }:
2026-03-21 17:44:14 +00:00
let
# Fetch pnpm dependencies
pnpmDeps = pkgs.pnpm.fetchDeps {
pname = "nidus-sync-frontend";
version = "0.0.11";
src = ./.;
2026-03-21 17:44:14 +00:00
hash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; # nix will tell you the correct hash
};
in
pkgs.buildGoModule rec {
meta = {
description = "Nidus Sync";
homepage = "https://github.com/Gleipnir-Technology/nidus-sync";
};
pname = "nidus-sync";
src = ./.;
subPackages = [];
version = "0.0.11";
2026-04-07 02:54:48 +00:00
vendorHash = "sha256-6g2gk7AyRmoqYfqwsTbzc5u5IKzlNFHjD3TeYXnf1zA=";
2026-03-04 03:41:41 +00:00
buildInputs = [ pkgs.proj ];
2026-04-07 02:54:48 +00:00
# Only inclue pkg-config here - it's needed for both phases
nativeBuildInputs = [
pkgs.pkg-config
2026-03-21 17:44:14 +00:00
pkgs.nodejs
2026-04-07 02:54:48 +00:00
pkgs.pnpm.configHook
];
2026-04-07 02:54:48 +00:00
# Override the go modules derivation to expclude pnpm stuff
overrideModAttrs = (_: {
preBuild = ""; # Don't run pnpm stuff during go modules fetch
});
pnpmDeps = pkgs.pnpm.fetchDeps {
2026-04-07 02:54:48 +00:00
inherit pname src version;
fetcherVersion = 2;
hash = "sha256-UvE49UmVw8zVFHywxRWyzL0EiZvuZjmm9hA1U98o2sA=";
};
2026-03-21 17:44:14 +00:00
preBuild = ''
2026-04-07 02:54:48 +00:00
# Add pnpm and nodejs to PATH for this phase only
pnpm install --offline --frozen-lockfile --ignore-scripts
2026-03-21 17:44:14 +00:00
# Icon generation
mkdir -p "./ts/gen"
pnpm generate-icons
# Remove static links
# Build frontend
pnpm build-rmo
pnpm build-sync
'';
}