diff --git a/pkgs/misc/drivers/hplip/3.16.11.nix b/pkgs/misc/drivers/hplip/3.16.11.nix index 4e9b4cbf0ae9..ebea49d9540a 100644 --- a/pkgs/misc/drivers/hplip/3.16.11.nix +++ b/pkgs/misc/drivers/hplip/3.16.11.nix @@ -142,8 +142,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/etc/sane.d/dll.d mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -171,9 +169,9 @@ pythonPackages.buildPythonApplication { postFixup = '' substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out - '' + stdenv.lib.optionalString (!withPlugin) '' - # A udev rule to notify users that they need the binary plugin. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \ diff --git a/pkgs/misc/drivers/hplip/3.18.5.nix b/pkgs/misc/drivers/hplip/3.18.5.nix index 7da6b2db930b..68220392fd00 100644 --- a/pkgs/misc/drivers/hplip/3.18.5.nix +++ b/pkgs/misc/drivers/hplip/3.18.5.nix @@ -174,8 +174,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/var/lib/hp cp ${hplipState} $out/var/lib/hp/hplip.state - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -203,9 +201,9 @@ pythonPackages.buildPythonApplication { postFixup = '' substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out - '' + stdenv.lib.optionalString (!withPlugin) '' - # A udev rule to notify users that they need the binary plugin. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \ diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix index 6c02fa52124e..851aa9f3f882 100644 --- a/pkgs/misc/drivers/hplip/default.nix +++ b/pkgs/misc/drivers/hplip/default.nix @@ -181,8 +181,6 @@ pythonPackages.buildPythonApplication { mkdir -p $out/var/lib/hp cp ${hplipState} $out/var/lib/hp/hplip.state - - rm $out/etc/udev/rules.d/56-hpmud.rules ''; # The installed executables are just symlinks into $out/share/hplip, @@ -210,9 +208,9 @@ pythonPackages.buildPythonApplication { postFixup = '' substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out - '' + stdenv.lib.optionalString (!withPlugin) '' - # A udev rule to notify users that they need the binary plugin. - # Needs a lot of patching but might save someone a bit of confusion: + # Patch udev rules: + # with plugin, they upload firmware to printers, + # without plugin, they complain about the missing plugin. substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \ --replace {,${bash}}/bin/sh \ --replace /usr/bin/nohup "" \