summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-11-20 21:47:17 +0100
committerTobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>2015-11-21 01:35:34 +0100
commit15324dc7d4ef50e5c7bdf5b85b10899f795fc772 (patch)
tree9585258e682992dd3176951c178462592dc057fa /pkgs/misc
parent2e248040a6a2de3846c791ac7df0f1d63b2481d0 (diff)
downloadnixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar.gz
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar.bz2
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar.lz
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar.xz
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.tar.zst
nixpkgs-15324dc7d4ef50e5c7bdf5b85b10899f795fc772.zip
hplip: remove duplicate platform definitions
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/drivers/hplip/default.nix17
1 files changed, 8 insertions, 9 deletions
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index c09017594a7..35d32f863ff 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -38,10 +38,15 @@ let
     };
 
   hplipArch = hplipPlatforms."${stdenv.system}"
-    or (abort "Unsupported platform ${stdenv.system}");
+    or (abort "HPLIP not supported on ${stdenv.system}");
+
+  pluginArches = [ "x86_32" "x86_64" ];
 
 in
 
+assert withPlugin -> builtins.elem hplipArch pluginArches
+  || abort "HPLIP plugin not supported on ${stdenv.system}";
+
 stdenv.mkDerivation {
   inherit name src;
 
@@ -108,13 +113,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  postInstall =
-    (stdenv.lib.optionalString (withPlugin && builtins.hasAttr stdenv.system hplipPlatforms)
-    (let hplipArch =
-          if stdenv.system == "i686-linux" then "x86_32"
-          else if stdenv.system == "x86_64-linux" then "x86_64"
-          else abort "Plugin platform must be i686-linux or x86_64-linux!";
-    in
+  postInstall = stdenv.lib.optionalString withPlugin
     ''
     sh ${plugin} --noexec --keep
     cd plugin_tmp
@@ -148,7 +147,7 @@ stdenv.mkDerivation {
     mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
 
     rm $out/etc/udev/rules.d/56-hpmud.rules
-  ''));
+  '';
 
   fixupPhase = ''
     # Wrap the user-facing Python scripts in $out/bin without turning the