depot/third_party/nixpkgs/pkgs/by-name/rm/rmfakecloud/package.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

36 lines
905 B
Nix

{ lib, fetchFromGitHub, buildGoModule, callPackage, enableWebui ? true }:
buildGoModule rec {
pname = "rmfakecloud";
version = "0.0.18";
src = fetchFromGitHub {
owner = "ddvk";
repo = pname;
rev = "v${version}";
sha256 = "sha256-J8oB5C5FYZTVq9zopHoL6WYpfTyiiyrQ4YSGu+2eaKw=";
};
vendorHash = "sha256-S43qNDAlDWhrkfSffCooveemR1Z7KXS18t97UoolgBM=";
ui = callPackage ./webui.nix { inherit version src; };
postPatch = if enableWebui then ''
mkdir -p ui/build
cp -r ${ui}/* ui/build
'' else ''
sed -i '/go:/d' ui/assets.go
'';
ldflags = [
"-s" "-w" "-X main.version=v${version}"
];
meta = with lib; {
description = "Host your own cloud for the Remarkable";
homepage = "https://ddvk.github.io/rmfakecloud/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ pacien martinetd ];
mainProgram = "rmfakecloud";
};
}