diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2025-06-20 11:50:11 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2025-06-20 11:50:11 -0500 |
commit | c3ae6a1c8783e93d7d6f0611ff7a77f3f9ffdff9 (patch) | |
tree | 76d2de05d3c934a08d0803a93749daecd68f8950 /derivations/xerox-workcentre-7800-series-driver/default.nix | |
parent | 3935f8feed4f5f4f13b0021639791df2954e8b48 (diff) | |
download | nixos-c3ae6a1c8783e93d7d6f0611ff7a77f3f9ffdff9.tar.xz nixos-c3ae6a1c8783e93d7d6f0611ff7a77f3f9ffdff9.zip |
add xerox 7800 series driver even though it seems to not be working yet
Diffstat (limited to 'derivations/xerox-workcentre-7800-series-driver/default.nix')
-rw-r--r-- | derivations/xerox-workcentre-7800-series-driver/default.nix | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/derivations/xerox-workcentre-7800-series-driver/default.nix b/derivations/xerox-workcentre-7800-series-driver/default.nix new file mode 100644 index 0000000..cfdaaae --- /dev/null +++ b/derivations/xerox-workcentre-7800-series-driver/default.nix @@ -0,0 +1,86 @@ +{ + stdenv, + lib, + fetchurl, + dpkg, + autoPatchelfHook, + cups, + xorg, +}: +let + debPlatform = + if stdenv.hostPlatform.system == "x86_64-linux" then + "x86_64" + else if stdenv.hostPlatform.system == "i686-linux" then + "i686" + else + throw "Unsupported system: ${stdenv.hostPlatform.system}"; +in +stdenv.mkDerivation rec { + pname = "xerox-workcentre-7800-series-driver"; + version = "5.20.661.4684"; + debpkg = "XeroxOfficev5Pkg-Linux${debPlatform}-${version}.deb"; + + src = fetchurl { + url = "https://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/${debpkg}"; + sha256 = "014k0r9ij3401mnab1qzv96bjl9x7rf11aw1ibf0q370pk9jqqjb"; # TODO correct hash for i686 + }; + + nativeBuildInputs = [ dpkg autoPatchelfHook ]; + # TODO add support for disable xorg + buildInputs = [ + cups + stdenv.cc.cc.lib + xorg.libX11 + xorg.libXrender + xorg.libXfixes + xorg.libXdamage + xorg.libXcomposite + xorg.libXcursor + xorg.libXrandr + xorg.libXext + xorg.libXinerama + ]; + + sourceRoot = "."; + unpackCmd = "dpkg-deb -x $curSrc ."; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out + + # Copy and patch the binaries and libraries + cp -r opt $out/ + cp -r usr $out/ + + # Move the PPD to CUPS model dir + mkdir -p $out/share/cups/model + cp opt/XeroxOffice/prtsys/ppd/*.ppd $out/share/cups/model/ + + # Install the CUPS filters + mkdir -p $out/lib/cups/filter + cp usr/lib/cups/filter/* $out/lib/cups/filter/ + + # Install man pages + mkdir -p $out/share/man + cp -r usr/share/man/* $out/share/man/ + + runHook postInstall + ''; + + meta = with lib; { + description = "Xerox WorkCentre 7800 Series Linux Printer Driver"; + longDescription = '' + WorkCentre 7830/7835/7845/7855 + ''; + homepage = "https://www.support.xerox.com/en-us/product/workcentre-7800-series/downloads?platform=linux"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + #license = licenses.unfree; + maintainers = []; + platforms = platforms.linux; + }; +} |