summary refs log tree commit diff
path: root/pkgs/tools/misc/autorandr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/misc/autorandr/default.nix')
-rw-r--r--pkgs/tools/misc/autorandr/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/tools/misc/autorandr/default.nix b/pkgs/tools/misc/autorandr/default.nix
index dc67c96ca1a..405eb29f6bf 100644
--- a/pkgs/tools/misc/autorandr/default.nix
+++ b/pkgs/tools/misc/autorandr/default.nix
@@ -1,7 +1,9 @@
 { stdenv
 , python3Packages
 , fetchFromGitHub
-, systemd }:
+, systemd
+, xrandr
+, makeWrapper }:
 
 let
   python = python3Packages.python;
@@ -12,6 +14,7 @@ in
     name = "autorandr-${version}";
 
     buildInputs = [ python ];
+    nativeBuildInputs = [ makeWrapper ];
 
     installPhase = ''
       runHook preInstall
@@ -33,9 +36,15 @@ in
         make install TARGETS='udev' PREFIX=$out DESTDIR=$out \
           UDEV_RULES_DIR=/etc/udev/rules.d
       ''}
+
       runHook postInstall
     '';
 
+    postFixup = ''
+      wrapProgram $out/bin/autorandr \
+        --prefix PATH : ${xrandr}/bin
+    '';
+
     src = fetchFromGitHub {
       owner = "phillipberndt";
       repo = "autorandr";