8 python = python3Packages.python;
15 buildInputs = [ python ];
17 # no wrapper, as autorandr --batch does os.environ.clear()
19 substituteInPlace autorandr.py \
20 --replace 'os.popen("xrandr' 'os.popen("${xrandr}/bin/xrandr' \
21 --replace '["xrandr"]' '["${xrandr}/bin/xrandr"]'
24 outputs = [ "out" "man" ];
28 make install TARGETS='autorandr' PREFIX=$out
30 make install TARGETS='bash_completion' DESTDIR=$out/share/bash-completion/completions
32 make install TARGETS='autostart_config' PREFIX=$out DESTDIR=$out
34 make install TARGETS='manpage' PREFIX=$man
36 ${if systemd != null then ''
37 make install TARGETS='systemd udev' PREFIX=$out DESTDIR=$out \
38 SYSTEMD_UNIT_DIR=/lib/systemd/system \
39 UDEV_RULES_DIR=/etc/udev/rules.d
40 substituteInPlace $out/etc/udev/rules.d/40-monitor-hotplug.rules \
41 --replace /bin/systemctl "/run/current-system/systemd/bin/systemctl"
43 make install TARGETS='pmutils' DESTDIR=$out \
44 PM_SLEEPHOOKS_DIR=/lib/pm-utils/sleep.d
45 make install TARGETS='udev' PREFIX=$out DESTDIR=$out \
46 UDEV_RULES_DIR=/etc/udev/rules.d
52 src = fetchFromGitHub {
53 owner = "phillipberndt";
56 sha256 = "0rmnqk2bi6bbd2if1rll37mlzlqxzmnazfffdhcpzskxwyaj4yn5";
60 homepage = "https://github.com/phillipberndt/autorandr/";
61 description = "Automatically select a display configuration based on connected devices";
62 license = licenses.gpl3Plus;
63 maintainers = with maintainers; [ coroa globin ];
64 platforms = platforms.unix;