nixos/cupsd: use cups-files.conf
This commit is contained in:
parent
8bfd6af9ed
commit
b71f3c4315
@ -90,6 +90,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cupsFilesConf = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
description = ''
|
||||||
|
The contents of the configuration file of the CUPS daemon
|
||||||
|
(<filename>cups-files.conf</filename>).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraConf = mkOption {
|
extraConf = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
@ -159,6 +168,12 @@ in
|
|||||||
{ source = pkgs.writeText "client.conf" cfg.clientConf;
|
{ source = pkgs.writeText "client.conf" cfg.clientConf;
|
||||||
target = "cups/client.conf";
|
target = "cups/client.conf";
|
||||||
}
|
}
|
||||||
|
{ source = pkgs.writeText "cups-files.conf" cfg.cupsFilesConf;
|
||||||
|
target = "cups/cups-files.conf";
|
||||||
|
}
|
||||||
|
{ source = pkgs.writeText "cupsd.conf" cfg.cupsdConf;
|
||||||
|
target = "cups/cupsd.conf";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
services.dbus.packages = [ cups ];
|
services.dbus.packages = [ cups ];
|
||||||
@ -177,6 +192,10 @@ in
|
|||||||
|
|
||||||
path = [ cups ];
|
path = [ cups ];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
CUPS_SERVERROOT = "/etc/cups";
|
||||||
|
};
|
||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -m 0755 -p /etc/cups
|
mkdir -m 0755 -p /etc/cups
|
||||||
@ -186,7 +205,7 @@ in
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig.Type = "forking";
|
serviceConfig.Type = "forking";
|
||||||
serviceConfig.ExecStart = "@${cups}/sbin/cupsd cupsd -c ${pkgs.writeText "cupsd.conf" cfg.cupsdConf}";
|
serviceConfig.ExecStart = "@${cups}/sbin/cupsd cupsd -c /etc/cups/cupsd.conf";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.printing.drivers =
|
services.printing.drivers =
|
||||||
@ -194,27 +213,18 @@ in
|
|||||||
pkgs.perl pkgs.coreutils pkgs.gnused pkgs.bc pkgs.gawk pkgs.gnugrep
|
pkgs.perl pkgs.coreutils pkgs.gnused pkgs.bc pkgs.gawk pkgs.gnugrep
|
||||||
];
|
];
|
||||||
|
|
||||||
services.printing.cupsdConf =
|
services.printing.cupsFilesConf =
|
||||||
''
|
''
|
||||||
LogLevel info
|
|
||||||
|
|
||||||
SystemGroup root wheel
|
SystemGroup root wheel
|
||||||
|
|
||||||
${concatMapStrings (addr: ''
|
|
||||||
Listen ${addr}
|
|
||||||
'') cfg.listenAddresses}
|
|
||||||
Listen /var/run/cups/cups.sock
|
|
||||||
|
|
||||||
# Note: we can't use ${cups}/etc/cups as the ServerRoot, since
|
# Note: we can't use ${cups}/etc/cups as the ServerRoot, since
|
||||||
# CUPS will write in the ServerRoot when e.g. adding new printers
|
# CUPS will write in the ServerRoot when e.g. adding new printers
|
||||||
# through the web interface.
|
# through the web interface.
|
||||||
ServerRoot /etc/cups
|
#ServerRoot /etc/cups
|
||||||
|
|
||||||
ServerBin ${bindir}/lib/cups
|
ServerBin ${bindir}/lib/cups
|
||||||
DataDir ${bindir}/share/cups
|
DataDir ${bindir}/share/cups
|
||||||
|
|
||||||
SetEnv PATH ${bindir}/lib/cups/filter:${bindir}/bin:${bindir}/sbin
|
|
||||||
|
|
||||||
AccessLog syslog
|
AccessLog syslog
|
||||||
ErrorLog syslog
|
ErrorLog syslog
|
||||||
PageLog syslog
|
PageLog syslog
|
||||||
@ -227,6 +237,18 @@ in
|
|||||||
# these programs to run as `lp' as well.
|
# these programs to run as `lp' as well.
|
||||||
User cups
|
User cups
|
||||||
Group lp
|
Group lp
|
||||||
|
'';
|
||||||
|
|
||||||
|
services.printing.cupsdConf =
|
||||||
|
''
|
||||||
|
LogLevel info
|
||||||
|
|
||||||
|
${concatMapStrings (addr: ''
|
||||||
|
Listen ${addr}
|
||||||
|
'') cfg.listenAddresses}
|
||||||
|
Listen /var/run/cups/cups.sock
|
||||||
|
|
||||||
|
SetEnv PATH ${bindir}/lib/cups/filter:${bindir}/bin:${bindir}/sbin
|
||||||
|
|
||||||
Browsing On
|
Browsing On
|
||||||
BrowseOrder allow,deny
|
BrowseOrder allow,deny
|
||||||
|
Loading…
x
Reference in New Issue
Block a user