aboutsummaryrefslogtreecommitdiff
path: root/configuration.nix
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-01-04 15:32:56 -0300
committerEuAndreh <eu@euandre.org>2022-01-04 15:32:56 -0300
commit4c9c45ce050f2fc79a789949a6166bb96c754b55 (patch)
treeed24f0a4fc472afa4e6684ecd788323802c9b127 /configuration.nix
parentconfiguration.nix: Move xdg.portal config to the bottom of the file (diff)
downloaddotfiles-4c9c45ce050f2fc79a789949a6166bb96c754b55.tar.gz
dotfiles-4c9c45ce050f2fc79a789949a6166bb96c754b55.tar.xz
configuration.nix: Add custom driver for printer
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix49
1 files changed, 47 insertions, 2 deletions
diff --git a/configuration.nix b/configuration.nix
index 6dd89c93..654583ab 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -404,14 +404,59 @@ in {
};
services = {
+ # Required for local network printer
+ avahi = {
+ enable = true;
+ nssmdns = true;
};
blueman.enable = true;
# We can see the actual generated crontab at /etc/crontab
- cron = {
+ printing = {
enable = true;
- systemCronJobs = crons;
+ drivers = let
+ epson-201401w = with pkgs;
+ stdenv.mkDerivation rec {
+ v = "201401w";
+ pname = "epson-${v}";
+ version = "1.0.0";
+
+ src = fetchurl {
+ urls = [
+ "https://download.ebz.epson.net/dsc/op/stable/SRPMS/epson-inkjet-printer-${v}-${version}-1lsb3.2.src.rpm"
+ "https://download3.ebz.epson.net/dsc/f/03/00/03/45/41/92e9c9254f0ee4230a069545ba27ec2858a2c457/epson-inkjet-printer-201401w-1.0.0-1lsb3.2.src.rpm"
+ ];
+ sha256 = "0c60m1sd59s4sda38dc5nniwa7dh1b0kv1maajr0x9d38gqlyk3x";
+ };
+
+ nativeBuildInputs = [ rpmextract autoreconfHook file ];
+
+ buildInputs = [ libjpeg cups ];
+
+ unpackPhase = ''
+ rpmextract $src
+ tar -zxf epson-inkjet-printer-${v}-${version}.tar.gz
+ tar -zxf epson-inkjet-printer-filter-${version}.tar.gz
+ for ppd in epson-inkjet-printer-${v}-${version}/ppds/*; do
+ substituteInPlace $ppd --replace "/opt/epson-inkjet-printer-${v}" "$out"
+ substituteInPlace $ppd --replace "/cups/lib" "/lib/cups"
+ done
+ cd epson-inkjet-printer-filter-${version}
+ '';
+
+ postInstall = ''
+ cd ../epson-inkjet-printer-${v}-${version}
+ cp -a lib64 resource watermark $out
+ mkdir -p $out/share/cups/model/epson-inkjet-printer-${v}
+ cp -a ppds $out/share/cups/model/epson-inkjet-printer-${v}/
+ cp -a Manual.txt $out/doc/
+ cp -a README $out/doc/README.driver
+ '';
+ };
+ in [
+ epson-201401w
+ ];
};
logrotate = {