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

54 lines
1.1 KiB
Nix
Raw Normal View History

2022-12-19 09:09:08 +00:00
{
config,
pkgs,
lib,
...
}: {
2021-05-31 09:15:44 +01:00
networking.firewall.enable = true;
2022-12-19 09:09:08 +00:00
networking.firewall.allowedTCPPorts = [631 6566];
networking.firewall.allowedUDPPorts = [631 6566];
2021-05-31 09:15:44 +01:00
services.printing = {
enable = true;
2022-12-19 09:09:08 +00:00
drivers = with pkgs; [epson-escpr];
listenAddresses = ["*:631"];
2021-05-31 09:15:44 +01:00
defaultShared = true;
browsing = true;
2022-12-19 09:09:08 +00:00
allowFrom = ["all"];
2021-05-31 09:15:44 +01:00
extraConf = ''
ServerAlias *
DefaultEncryption Never
'';
};
2022-12-19 09:09:08 +00:00
hardware.printers.ensurePrinters = [
{
description = "Epson XP-540";
location = "connected to bolty";
name = "epson_xp540";
deviceUri = "usb://EPSON/XP-540%20Series?serial=583245393030303936&interface=1";
model = "raw";
ppdOptions = {PageSize = "A4";};
}
];
2021-05-31 09:15:44 +01:00
hardware.sane = {
enable = true;
2022-12-19 09:09:08 +00:00
extraBackends = with pkgs; [utsushi sane-airscan gawk];
2021-05-31 09:15:44 +01:00
snapshot = true;
};
2022-12-19 09:09:08 +00:00
services.udev.packages = [pkgs.utsushi];
2021-05-31 09:15:44 +01:00
2022-12-19 09:09:08 +00:00
environment.systemPackages = with pkgs; [gawk];
2021-05-31 09:15:44 +01:00
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
'';
};
}