ninurta: enable printer sharing
This commit is contained in:
parent
e135f57101
commit
2083708a45
2 changed files with 45 additions and 0 deletions
|
@ -17,6 +17,7 @@ in
|
|||
imports = [
|
||||
../modules/profiles/server.nix
|
||||
./hardware-configuration.nix
|
||||
./printing.nix
|
||||
];
|
||||
|
||||
services.soft-serve = {
|
||||
|
@ -388,10 +389,12 @@ in
|
|||
22 # SSH
|
||||
80 # HTTP
|
||||
443 # HTTPS
|
||||
631 # Printing (TODO only allow from some networks)
|
||||
3000 # Hydra
|
||||
softServePort
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
631 # Printing (TODO only allow from some networks)
|
||||
51234 # Wireguard
|
||||
51235 # Wireguard
|
||||
];
|
||||
|
|
42
nixos/ninurta/printing.nix
Normal file
42
nixos/ninurta/printing.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [ pkgs.brlaser ];
|
||||
# Remove all state at the start of the service
|
||||
stateless = true;
|
||||
};
|
||||
|
||||
hardware = {
|
||||
printers = {
|
||||
ensurePrinters = [
|
||||
{
|
||||
name = "Brother_HL-L2310D";
|
||||
model = "drv:///brlaser.drv/brl2320d.ppd";
|
||||
location = "BS";
|
||||
deviceUri = "usb://Brother/HL-L2310D%20series?serial=E78096H3N771439";
|
||||
ppdOptions = {
|
||||
PageSize = "A4";
|
||||
Duplex = "DuplexNoTumble";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
openFirewall = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
userServices = true;
|
||||
};
|
||||
};
|
||||
services.printing = {
|
||||
listenAddresses = [ "192.168.101.184:631" "fd42:9c3b:f96d:101:4a21:bff:fe3e:9cfe:631" ];
|
||||
allowFrom = [ "from 192.168.101.0/24" ];
|
||||
browsing = true;
|
||||
defaultShared = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue