mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
printing.nix can't conditionally set users.users.me.extraGroups — any mention of users.users.me in the module system creates the user entry and triggers the isNormalUser/isSystemUser assertion on machines without a 'me' user (like zaatar). Move lp/scanner groups to configs/default.nix where users.users.me is defined. On zaatar, root gets lp/scanner groups directly.
51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{ pkgs, lib, ... }:
|
|
let
|
|
hp-driver = pkgs.hplipWithPlugin;
|
|
in
|
|
{
|
|
services.printing = {
|
|
enable = true;
|
|
drivers = [ hp-driver ];
|
|
};
|
|
|
|
hardware.sane = {
|
|
enable = true;
|
|
extraBackends = [ hp-driver ];
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
pkgs.system-config-printer
|
|
pkgs.simple-scan
|
|
hp-driver
|
|
];
|
|
|
|
# allow connecting to .local printers
|
|
services.avahi = {
|
|
nssmdns4 = true;
|
|
enable = true;
|
|
openFirewall = true;
|
|
};
|
|
|
|
# users.users.me.extraGroups is set in configs/default.nix which defines the "me" user
|
|
|
|
hardware.printers.ensurePrinters = [
|
|
{
|
|
name = "OfficeJet";
|
|
location = "Zimmer";
|
|
deviceUri = "https://${pkgs.lib.niveum.localAddresses.officejet}";
|
|
model = "drv:///hp/hpcups.drv/hp-officejet_4650_series.ppd";
|
|
ppdOptions = {
|
|
Duplex = "DuplexNoTumble"; # DuplexNoTumble DuplexTumble None
|
|
PageSize = "A4"; # A4 A4.FB A4.Duplex
|
|
MediaType = "Plain";
|
|
OutputMode = "Normal";
|
|
ColorModel = "KGray"; # RGB CMYGray KGray
|
|
};
|
|
}
|
|
];
|
|
}
|
|
/*
|
|
HP/hp-officejet_4650_series.ppd.gz
|
|
drv:///hp/hpcups.drv/hp-officejet_4650_series.ppd
|
|
*/
|