Files
nixpkgs/pkgs/by-name/rm/rmfakecloud/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

72 lines
1.7 KiB
Nix

{
lib,
fetchFromGitHub,
buildGoModule,
enableWebui ? true,
pnpm_9,
nodejs,
nixosTests,
}:
buildGoModule rec {
pname = "rmfakecloud";
version = "0.0.25";
src = fetchFromGitHub {
owner = "ddvk";
repo = "rmfakecloud";
rev = "v${version}";
hash = "sha256-dembIFEoKQEZabsl7oK8rzvV2G7nhmebfw0AGUBanYs=";
};
vendorHash = "sha256-ColOCdKa/sKoLnF/3idBIEyFB2JWYM+1y5TdC/LZT4A=";
# if using webUI build it
# use env because of https://github.com/NixOS/nixpkgs/issues/358844
env.pnpmRoot = "ui";
env.pnpmDeps = pnpm_9.fetchDeps {
inherit pname version src;
sourceRoot = "${src.name}/ui";
pnpmLock = "${src}/ui/pnpm-lock.yaml";
fetcherVersion = 1;
hash = "sha256-uywmHN9HWKi0CaqTg9uEio2XCu6ap9v2xtbodW/6b4Q=";
};
preBuild = lib.optionals enableWebui ''
# using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart
rm -r ui/node_modules/sass-embedded ui/node_modules/.pnpm/sass-embedded*
# avoid re-running pnpm i...
touch ui/pnpm-lock.yaml
make ui/dist
'';
nativeBuildInputs = lib.optionals enableWebui [
nodejs
pnpm_9.configHook
];
# ... or don't embed it in the server
postPatch = lib.optionals (!enableWebui) ''
sed -i '/go:/d' ui/assets.go
'';
ldflags = [
"-s"
"-w"
"-X main.version=v${version}"
];
passthru.tests.rmfakecloud = nixosTests.rmfakecloud;
meta = with lib; {
description = "Host your own cloud for the Remarkable";
homepage = "https://ddvk.github.io/rmfakecloud/";
license = licenses.agpl3Only;
maintainers = with maintainers; [
euxane
martinetd
];
mainProgram = "rmfakecloud";
};
}