1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 14:11:36 +00:00
nixpkgs/pkgs/tools/misc/autorandr/default.nix
Bjørn Forsman 28ac782583 Some description fixes
There are many more packages to fix, this is just a start.

Rules:
 * Don't repeat the package name (not always that easy...)
 * Start with capital letter
 * Don't end with full stop
 * Don't start with "The ..." or "A ..."

I've also added descriptions to some packages and rewritten others.
2013-10-05 19:36:23 +02:00

41 lines
1.1 KiB
Nix

{ fetchgit
, stdenv
, enableXRandr ? true, xrandr ? null
, enableDisper ? false, disper ? null
, xdpyinfo }:
assert enableXRandr -> xrandr != null;
assert enableDisper -> disper != null;
let
rev = "4f5e2401ef";
in
stdenv.mkDerivation {
name = "autorandr-${rev}";
src = fetchgit {
inherit rev;
url = "https://github.com/wertarbyte/autorandr.git";
};
patchPhase = ''
substituteInPlace "autorandr" \
--replace "/usr/bin/xrandr" "${if enableXRandr then xrandr else "/nowhere"}/bin/xrandr" \
--replace "/usr/bin/disper" "${if enableDisper then disper else "/nowhere"}/bin/disper" \
--replace "/usr/bin/xdpyinfo" "${xdpyinfo}/bin/xdpyinfo"
'';
installPhase = ''
mkdir -p "$out/etc/bash_completion.d"
cp -v bash_completion/autorandr "$out/etc/bash_completion.d"
mkdir -p "$out/bin"
cp -v autorandr auto-disper $out/bin
'';
meta = {
description = "Automatic display configuration selector based on connected devices";
homepage = https://github.com/wertarbyte/autorandr;
maintainer = [ stdenv.lib.maintainers.coroa ];
};
}