Skip to content

Commit

Permalink
Merge pull request #938 from kachick/epson-printer
Browse files Browse the repository at this point in the history
Make it possible to use Epson printer and the bundled scanner in NixOS
  • Loading branch information
kachick authored Nov 15, 2024
2 parents e568968 + 2d788a5 commit 1c19ee8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
3 changes: 0 additions & 3 deletions nixos/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
enable = true;
};

# Enable CUPS to print documents.
services.printing.enable = true;

hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot

Expand Down
18 changes: 17 additions & 1 deletion nixos/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"wheel"
"input" # For finger print in GDM
"libvirtd" # For virt-manager
"scanner"
"lp" # For scanner
];
packages = [
# Don't install spotify, it does not activate IME and no binary cache with the unfree license.
Expand Down Expand Up @@ -61,7 +63,10 @@
};
};

services.udev.packages = with pkgs; [ gnome.gnome-settings-daemon ];
services.udev.packages = with pkgs; [
gnome.gnome-settings-daemon
sane-airscan
];

# To avoid unexpected overriding with the NixOS module. I prefer gpg-agent or another way for that.
programs.ssh.enableAskPassword = false;
Expand Down Expand Up @@ -112,6 +117,17 @@

services.blueman.enable = true;

services.printing = {
enable = true;
drivers = [ pkgs.epson-escpr ];
};

# To setup a wireless printer
services.avahi = {
enable = true;
nssmdns4 = true;
};

environment.systemPackages =
[
# version in nixos-24.05 does not enable IME
Expand Down
9 changes: 8 additions & 1 deletion nixos/hardware.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, ... }:
{ lib, pkgs, ... }:
{
services.udev = {
enable = true;
Expand All @@ -16,4 +16,11 @@
KEYBOARD_KEY_70039=leftctrl # original: capslock, Both US and JIS have same keycode for capslock
'';
};

# http://www.sane-project.org/sane-mfgs.html#Z-EPSON
# Apple AirScan supported devices: https://support.apple.com/ja-jp/HT201311
hardware.sane = {
enable = true;
extraBackends = [ pkgs.sane-airscan ];
};
}

0 comments on commit 1c19ee8

Please sign in to comment.