dotfiles/nixos/boxes/brix/print-server.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

2021-06-12 15:46:26 +01:00
{ config, pkgs, lib, ... }:
2021-05-31 09:15:44 +01:00
{
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 631 6566 ];
networking.firewall.allowedUDPPorts = [ 631 6566 ];
services.printing = {
enable = true;
drivers = with pkgs; [ epson-escpr ];
listenAddresses = [ "*:631" ];
defaultShared = true;
browsing = true;
allowFrom = [ "all" ];
extraConf = ''
ServerAlias *
DefaultEncryption Never
'';
};
2021-06-12 15:46:26 +01:00
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
];
2021-05-31 09:15:44 +01:00
hardware.printers.ensurePrinters = [{
description = "Epson XP-540";
location = "connected to brix";
name = "epson_xp540";
deviceUri = "usb://EPSON/XP-540%20Series?serial=583245393030303936&interface=1";
model = "raw";
ppdOptions = { PageSize = "A4"; };
}];
hardware.sane = {
enable = true;
2021-06-12 15:46:26 +01:00
extraBackends = with pkgs; [ utsushi sane-airscan gawk ];
2021-05-31 09:15:44 +01:00
snapshot = true;
};
services.udev.packages = [ pkgs.utsushi ];
environment.systemPackages = with pkgs; [ gawk ];
services.saned = {
enable = true;
extraConfig = ''
2021-07-31 15:55:55 +01:00
100.69.222.80
10.0.24.0/24
10.0.0.1/24
foureighty
hagath
2021-05-31 09:15:44 +01:00
'';
};
}