about summary refs log tree commit diff
path: root/pkgs/tools/wayland/wluma/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/wayland/wluma/default.nix')
-rw-r--r--pkgs/tools/wayland/wluma/default.nix37
1 files changed, 31 insertions, 6 deletions
diff --git a/pkgs/tools/wayland/wluma/default.nix b/pkgs/tools/wayland/wluma/default.nix
index 07142210c3039..94201db4a395f 100644
--- a/pkgs/tools/wayland/wluma/default.nix
+++ b/pkgs/tools/wayland/wluma/default.nix
@@ -1,55 +1,80 @@
 { lib
+, stdenv
 , fetchFromGitHub
 , makeWrapper
 , rustPlatform
+, marked-man
+, coreutils
 , vulkan-loader
 , wayland
 , pkg-config
 , udev
 , v4l-utils
+, dbus
+, nix-update-script
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "wluma";
-  version = "4.3.0";
+  version = "4.4.0";
 
   src = fetchFromGitHub {
     owner = "maximbaz";
     repo = "wluma";
     rev = version;
-    sha256 = "sha256-FaX87k8LdBhrBX4qvokSHkcNaQZ0+oSbkn9d0dK6FGo=";
+    sha256 = "sha256-Ow3SjeulYiHY9foXrmTtLK3F+B3+DrtDjBUke3bJeDw=";
   };
 
+  postPatch = ''
+    substituteInPlace Makefile --replace \
+      'target/release/$(BIN)' \
+      'target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/$(BIN)'
+
+    # Needs chmod and chgrp
+    substituteInPlace 90-wluma-backlight.rules --replace \
+      'RUN+="/bin/' 'RUN+="${coreutils}/bin/'
+
+    substituteInPlace wluma.service --replace \
+      'ExecStart=/usr/bin/wluma' 'ExecStart=${placeholder "out"}/bin/wluma'
+  '';
+
   cargoLock = {
     lockFile = ./Cargo.lock;
-    outputHashes = {
-      "toml-0.5.9" = "sha256-WUQFF9Hfo3JK65AKAF7qNZex6l7F3N8HXmJlu8cJUEE=";
-    };
   };
 
   nativeBuildInputs = [
     makeWrapper
     pkg-config
     rustPlatform.bindgenHook
+    marked-man
   ];
 
   buildInputs = [
     udev
     v4l-utils
     vulkan-loader
+    dbus
   ];
 
+  postBuild = ''
+    make docs
+  '';
+
+  dontCargoInstall = true;
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
   postInstall = ''
     wrapProgram $out/bin/wluma \
       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}"
   '';
 
+  passthru.updateScript = nix-update-script { };
+
   meta = with lib; {
     description = "Automatic brightness adjustment based on screen contents and ALS";
     homepage = "https://github.com/maximbaz/wluma";
     changelog = "https://github.com/maximbaz/wluma/releases/tag/${version}";
     license = licenses.isc;
-    maintainers = with maintainers; [ yshym jmc-figueira ];
+    maintainers = with maintainers; [ yshym jmc-figueira atemu ];
     platforms = platforms.linux;
     mainProgram = "wluma";
   };