diff --git a/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix b/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix index 32470d4ab4ba..d02c7b63913b 100644 --- a/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix +++ b/pkgs/by-name/cu/cups-kyocera-3500-4500/package.nix @@ -1,6 +1,6 @@ { lib , stdenv -, fetchzip +, fetchurl , cups , autoPatchelfHook , python3Packages @@ -22,18 +22,29 @@ stdenv.mkDerivation rec { dontStrip = true; - src = fetchzip { + src = fetchurl { # Steps to find the release download URL: # 1. Go to https://www.kyoceradocumentsolutions.us/en/support/downloads.html # 2. Search for printer model, e.g. "TASKalfa 6053ci" # 3. Locate e.g. "Linux Print Driver (9.3)" in the list urls = [ - "https://dam.kyoceradocumentsolutions.com/content/dam/gdam_dc/dc_global/executables/driver/product_085/KyoceraLinuxPackages-${date}.tar.gz" + "https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/MA_PA_4500ci_Linux_gz.download.gz" + "https://web.archive.org/web/20241123173620/https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/MA_PA_4500ci_Linux_gz.download.gz" ]; hash = "sha256-pqBtfKiQo/+cF8fG5vsEQvr8UdxjGsSShXI+6bun03c="; - extension = "tar.gz"; - stripRoot = false; + recursiveHash = true; + downloadToTemp = true; postFetch = '' + unpackDir="$TMPDIR/unpack" + mkdir "$unpackDir" + cd "$unpackDir" + + mv "$downloadedFile" "$TMPDIR/source.tar.gz.gz" + gunzip "$TMPDIR/source.tar.gz.gz" + unpackFile "$TMPDIR/source.tar.gz" + chmod -R +w "$unpackDir" + mv "$unpackDir" "$out" + # delete redundant Linux package dirs to reduce size in the Nix store; only keep Debian rm -r $out/{CentOS,Fedora,OpenSUSE,Redhat,Ubuntu} '';