Create a nixos module for cups-browsed
This commit is contained in:
parent
415b32311f
commit
a7024cb4b4
@ -4,7 +4,7 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
inherit (pkgs) cups;
|
inherit (pkgs) cups cups_filters;
|
||||||
|
|
||||||
cfg = config.services.printing;
|
cfg = config.services.printing;
|
||||||
|
|
||||||
@ -123,6 +123,19 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
browsedConf = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example =
|
||||||
|
''
|
||||||
|
BrowsePoll cups.example.com
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
The contents of the configuration. file of the CUPS Browsed daemon
|
||||||
|
(<filename>cups-browsed.conf</filename>)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
drivers = mkOption {
|
drivers = mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
example = literalExample "[ pkgs.splix ]";
|
example = literalExample "[ pkgs.splix ]";
|
||||||
@ -161,6 +174,7 @@ in
|
|||||||
environment.etc."cups/client.conf".text = cfg.clientConf;
|
environment.etc."cups/client.conf".text = cfg.clientConf;
|
||||||
environment.etc."cups/cups-files.conf".text = cfg.cupsFilesConf;
|
environment.etc."cups/cups-files.conf".text = cfg.cupsFilesConf;
|
||||||
environment.etc."cups/cupsd.conf".text = cfg.cupsdConf;
|
environment.etc."cups/cupsd.conf".text = cfg.cupsdConf;
|
||||||
|
environment.etc."cups/cups-browsed.conf".text = cfg.browsedConf;
|
||||||
|
|
||||||
services.dbus.packages = [ cups ];
|
services.dbus.packages = [ cups ];
|
||||||
|
|
||||||
@ -195,6 +209,22 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.cups-browsed =
|
||||||
|
{ description = "Make remote CUPS printers available locally";
|
||||||
|
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "cups.service" "avahi-daemon.service" ];
|
||||||
|
after = [ "cups.service" "avahi-daemon.service" ];
|
||||||
|
|
||||||
|
path = [ cups ];
|
||||||
|
|
||||||
|
serviceConfig.ExecStart = "${cups_filters}/bin/cups-browsed";
|
||||||
|
|
||||||
|
restartTriggers =
|
||||||
|
[ config.environment.etc."cups/cups-browsed.conf".source
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
services.printing.drivers =
|
services.printing.drivers =
|
||||||
[ cups pkgs.ghostscript pkgs.cups_filters additionalBackends
|
[ cups pkgs.ghostscript pkgs.cups_filters additionalBackends
|
||||||
pkgs.perl pkgs.coreutils pkgs.gnused pkgs.bc pkgs.gawk pkgs.gnugrep
|
pkgs.perl pkgs.coreutils pkgs.gnused pkgs.bc pkgs.gawk pkgs.gnugrep
|
||||||
|
Loading…
x
Reference in New Issue
Block a user