From 8ab4b1ecb6c4ebafad8f5a7dcaa161894452fb7a Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 17 Oct 2014 09:18:55 +0200 Subject: common-workstation: Fix eval on empty head config. Broke evaluation for tishtushi and arilou, because xrandrHeads is set to an empty list over there (aka "unconfigured"). Signed-off-by: aszlig --- common-workstation.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common-workstation.nix b/common-workstation.nix index 3fcff9d6..ff170399 100644 --- a/common-workstation.nix +++ b/common-workstation.nix @@ -115,7 +115,8 @@ in { src = pkgs.slimThemes.nixosSlim; phases = [ "unpackPhase" "patchPhase" "installPhase" ]; patchPhase = let - centerLeft = 100 / (lib.length randrHeads * 2); + headFactor = if randrHeads == [] then 1 else lib.length randrHeads; + centerLeft = 100 / (headFactor * 2); in '' ${pkgs.imagemagick}/bin/mogrify \ -fill '#080010' -draw 'color 0,0 reset' \ -- cgit 1.4.1