summary refs log tree commit diff
path: root/pkgs/applications/misc/health/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/health/default.nix')
-rw-r--r--pkgs/applications/misc/health/default.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/applications/misc/health/default.nix b/pkgs/applications/misc/health/default.nix
new file mode 100644
index 00000000000..84683c1a4d3
--- /dev/null
+++ b/pkgs/applications/misc/health/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, rustPlatform
+, rustc
+, cargo
+, wrapGAppsHook4
+, blueprint-compiler
+, libadwaita
+, libsecret
+, tracker
+, darwin
+}:
+
+stdenv.mkDerivation rec {
+  pname = "health";
+  version = "0.94.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "World";
+    repo = pname;
+    rev = version;
+    hash = "sha256-KS0sdCQg2LqQB0K1cUbAjA8VITn5rAb8XCWjOKYbPqM=";
+  };
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    patches = [ ./update_gtk4_cargo_deps.patch ];
+    name = "${pname}-${version}";
+    hash = "sha256-j0I0vKoGaf2pce2C/xkz+nJYCfLvHB5F6Q9XpJtABMI=";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/max_size_tightending_thresh_0.94.0.patch?h=health&id=d35d89760964b00ad457eca07855143a1dcbabdf";
+      hash = "sha256-ndoxyrm+SVGVxfUbc5sQItQwzK75ZtKMSGUOB9mzBmo=";
+    })
+    (fetchpatch {
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/max_value_0.94.0.patch?h=health&id=d35d89760964b00ad457eca07855143a1dcbabdf";
+      hash = "sha256-YKVQNtz+RWN6Ydw+kbStCVf0vu0eTrMKGd6kEijFG00=";
+    })
+    # patch both or it will complain Cargo.lock mismatch
+    ./update_gtk4_cargo_deps.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    rustPlatform.cargoSetupHook
+    rustc
+    cargo
+    wrapGAppsHook4
+    blueprint-compiler
+  ];
+
+  buildInputs = [
+    libadwaita
+    libsecret
+    tracker
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.Security
+    darwin.apple_sdk.frameworks.Foundation
+  ];
+
+  meta = with lib; {
+    description = "A health tracking app for the GNOME desktop";
+    homepage = "https://apps.gnome.org/app/dev.Cogitri.Health";
+    license = licenses.gpl3Plus;
+    mainProgram = "dev.Cogitri.Health";
+    maintainers = with maintainers; [ aleksana ];
+    platforms = platforms.unix;
+  };
+}