Merge pull request #5804 from DamienCassou/cups-browsed
Create a nixos module for cups-browsed
This commit is contained in:
commit
a6a5a05ff8
|
@ -4,7 +4,7 @@ with lib;
|
|||
|
||||
let
|
||||
|
||||
inherit (pkgs) cups;
|
||||
inherit (pkgs) cups cups_filters;
|
||||
|
||||
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 {
|
||||
type = types.listOf types.path;
|
||||
example = literalExample "[ pkgs.splix ]";
|
||||
|
@ -161,6 +174,7 @@ in
|
|||
environment.etc."cups/client.conf".text = cfg.clientConf;
|
||||
environment.etc."cups/cups-files.conf".text = cfg.cupsFilesConf;
|
||||
environment.etc."cups/cupsd.conf".text = cfg.cupsdConf;
|
||||
environment.etc."cups/cups-browsed.conf".text = cfg.browsedConf;
|
||||
|
||||
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 =
|
||||
[ cups pkgs.ghostscript pkgs.cups_filters additionalBackends
|
||||
pkgs.perl pkgs.coreutils pkgs.gnused pkgs.bc pkgs.gawk pkgs.gnugrep
|
||||
|
|
Loading…
Reference in New Issue