nixos/uptime-kuma: Add additional lockdown settings to systemd unit (#361452)
[NixPkgs.git] / pkgs / by-name / oo / oo7 / package.nix
blob4fcd76aedd5f31cb12b1b2d818803ed118a7cebe
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   oo7,
6   openssl,
7   pkg-config,
8   testers,
9 }:
11 rustPlatform.buildRustPackage rec {
12   pname = "oo7";
13   version = "0.3.3";
15   src = fetchFromGitHub {
16     owner = "bilelmoussaoui";
17     repo = "oo7";
18     rev = version;
19     hash = "sha256-KoceqJCxb61EF29Fw9UU2LCHxDR0ExR3lnt85Nqg6tg=";
20   };
22   cargoLock = {
23     lockFile = ./Cargo.lock;
24   };
26   postPatch = ''
27     ln -s ${./Cargo.lock} Cargo.lock
28   '';
30   nativeBuildInputs = [ pkg-config ];
32   buildInputs = [ openssl ];
34   postInstall = ''
35     install -Dm644 portal/data/oo7-portal.portal $out/share/xdg-desktop-portal/portals/oo7.portal
36     install -Dm644 portal/data/oo7-portal.service $out/share/dbus-1/services/oo7-portal.service
37     substituteInPlace $out/share/dbus-1/services/oo7-portal.service \
38       --replace-fail "@bindir@" "$out/bin"
39   '';
41   passthru = {
42     tests.testVersion = testers.testVersion { package = oo7; };
44     # TODO: re-enable this when upstream adds a Cargo.lock
45     # updateScript = nix-update-script { };
46   };
48   meta = with lib; {
49     description = "James Bond went on a new mission as a Secret Service provider";
50     homepage = "https://github.com/bilelmoussaoui/oo7";
51     changelog = "https://github.com/bilelmoussaoui/oo7/releases/tag/${src.rev}";
52     license = licenses.mit;
53     maintainers = with maintainers; [
54       getchoo
55       Scrumplex
56     ];
57     platforms = platforms.linux;
58     mainProgram = "oo7-cli";
59   };