✨ make printer accessible via network
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 8m26s
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 8m26s
This commit is contained in:
parent
2aa65490b4
commit
97ca643aad
5 changed files with 56 additions and 31 deletions
|
@ -1,28 +0,0 @@
|
|||
{ config, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
|
||||
options.components.gui.cups.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.components.gui.enable;
|
||||
};
|
||||
|
||||
config = mkIf (config.components.gui.cups.enable) {
|
||||
|
||||
hardware.printers.ensurePrinters = [
|
||||
{
|
||||
description = "Lexmark E350d";
|
||||
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
|
||||
location = "office";
|
||||
name = "Lexmark_E350d";
|
||||
model = "drv:///sample.drv/generic.ppd";
|
||||
ppdOptions = {
|
||||
job-sheets = "none, none";
|
||||
media = "na_letter_8.5x11in";
|
||||
sides = "one-sided";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
}
|
|
@ -14,7 +14,6 @@ with lib;
|
|||
# todo : structure with home-manager and such is not cool, create another structure
|
||||
./audio.nix
|
||||
./browser.nix
|
||||
./cups.nix
|
||||
./home-manager
|
||||
./kde.nix
|
||||
./kmonad.nix
|
||||
|
|
|
@ -33,6 +33,8 @@ with lib;
|
|||
genpass
|
||||
tree
|
||||
killall
|
||||
|
||||
nom # nix output monitor
|
||||
nix-tree
|
||||
|
||||
vulnix
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
./service-atuin.nix
|
||||
./service-forgejo.nix
|
||||
|
||||
./service-cups.nix
|
||||
./service-paperless-backup.nix
|
||||
./service-paperless-tika.nix
|
||||
./service-paperless.nix
|
||||
|
@ -78,8 +79,6 @@
|
|||
|
||||
healthchecks.closed.wg0.host = "10.100.0.2";
|
||||
|
||||
services.printing.enable = false;
|
||||
|
||||
networking.hostName = "chungus";
|
||||
|
||||
# nix-shell -p speedtest_cli --run speedtest
|
||||
|
|
53
machines/chungus/service-cups.nix
Normal file
53
machines/chungus/service-cups.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
pkgs,
|
||||
zerotierInterface,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
#networking.firewall.interfaces.${zerotierInterface}.allowedTCPPorts = [ 631 ];
|
||||
networking.firewall.allowedTCPPorts = [ 631 ];
|
||||
|
||||
services.printing = {
|
||||
enable = true;
|
||||
listenAddresses = [ "[::]:631" ];
|
||||
extraConf = "ServerAlias chungus.bear chungus.ingolf-wagner.de";
|
||||
allowFrom = [ "all" ];
|
||||
defaultShared = true;
|
||||
browsing = true;
|
||||
browsedConf = ''
|
||||
BrowseRemoteProtocols dnssd
|
||||
CreateIPPPrinterQueues All
|
||||
'';
|
||||
};
|
||||
|
||||
hardware.printers.ensureDefaultPrinter = "Lexmark_E350d";
|
||||
|
||||
hardware.printers.ensurePrinters = [
|
||||
{
|
||||
description = "Lexmark E350d";
|
||||
deviceUri = "usb://Lexmark/E350d?serial=622Z9ZC";
|
||||
location = "office";
|
||||
name = "Lexmark_E350d";
|
||||
model = "drv:///sample.drv/generic.ppd";
|
||||
ppdOptions = {
|
||||
job-sheets = "none, none";
|
||||
media = "iso_a4_210x297mm"; # ← A4 statt Letter
|
||||
sides = "two-sided-long-edge"; # ← Doppelseitig, wie ein Buch
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
# avahi is needed for cups to work nice and smooth
|
||||
|
||||
healthchecks.localCommands.test-avahi = pkgs.writers.writeBash "test-avahi" ''
|
||||
dig @${config.clan.core.vars.generators.zerotier.files.zerotier-ip.value} -p 5353 _ipp._tcp.local. PTR +time=3 +tries=1 +retry=0
|
||||
'';
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue