mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
cups: Build with SERVERROOT set to /etc/cups
This commit is contained in:
parent
ffdabf02b9
commit
be0e73b938
2 changed files with 13 additions and 21 deletions
|
@ -11,20 +11,16 @@ let
|
||||||
additionalBackends = pkgs.runCommand "additional-cups-backends" { }
|
additionalBackends = pkgs.runCommand "additional-cups-backends" { }
|
||||||
''
|
''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
if [ ! -e ${pkgs.cups}/lib/cups/backend/smb ]; then
|
if [ ! -e ${cups}/lib/cups/backend/smb ]; then
|
||||||
mkdir -p $out/lib/cups/backend
|
mkdir -p $out/lib/cups/backend
|
||||||
ln -sv ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb
|
ln -sv ${pkgs.samba}/bin/smbspool $out/lib/cups/backend/smb
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Provide support for printing via HTTPS.
|
# Provide support for printing via HTTPS.
|
||||||
if [ ! -e ${pkgs.cups}/lib/cups/backend/https ]; then
|
if [ ! -e ${cups}/lib/cups/backend/https ]; then
|
||||||
mkdir -p $out/lib/cups/backend
|
mkdir -p $out/lib/cups/backend
|
||||||
ln -sv ${pkgs.cups}/lib/cups/backend/ipp $out/lib/cups/backend/https
|
ln -sv ${cups}/lib/cups/backend/ipp $out/lib/cups/backend/https
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Import filter configuration from Ghostscript.
|
|
||||||
mkdir -p $out/share/cups/mime/
|
|
||||||
ln -v -s "${pkgs.ghostscript}/etc/cups/"* $out/share/cups/mime/
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Here we can enable additional backends, filters, etc. that are not
|
# Here we can enable additional backends, filters, etc. that are not
|
||||||
|
@ -162,8 +158,6 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ cups ];
|
environment.systemPackages = [ cups ];
|
||||||
|
|
||||||
environment.variables.CUPS_SERVERROOT = "/etc/cups";
|
|
||||||
|
|
||||||
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;
|
||||||
|
@ -184,10 +178,6 @@ in
|
||||||
|
|
||||||
path = [ cups ];
|
path = [ cups ];
|
||||||
|
|
||||||
environment = {
|
|
||||||
CUPS_SERVERROOT = "/etc/cups";
|
|
||||||
};
|
|
||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
mkdir -m 0755 -p /etc/cups
|
mkdir -m 0755 -p /etc/cups
|
||||||
|
@ -197,11 +187,16 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
serviceConfig.Type = "forking";
|
serviceConfig.Type = "forking";
|
||||||
serviceConfig.ExecStart = "@${cups}/sbin/cupsd cupsd -c /etc/cups/cupsd.conf";
|
serviceConfig.ExecStart = "@${cups}/sbin/cupsd cupsd";
|
||||||
|
|
||||||
|
restartTriggers =
|
||||||
|
[ config.environment.etc."cups/cups-files.conf".source
|
||||||
|
config.environment.etc."cups/cupsd.conf".source
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.printing.drivers =
|
services.printing.drivers =
|
||||||
[ pkgs.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
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -209,11 +204,6 @@ in
|
||||||
''
|
''
|
||||||
SystemGroup root wheel
|
SystemGroup root wheel
|
||||||
|
|
||||||
# Note: we can't use ${cups}/etc/cups as the ServerRoot, since
|
|
||||||
# CUPS will write in the ServerRoot when e.g. adding new printers
|
|
||||||
# through the web interface.
|
|
||||||
#ServerRoot /etc/cups
|
|
||||||
|
|
||||||
ServerBin ${bindir}/lib/cups
|
ServerBin ${bindir}/lib/cups
|
||||||
DataDir ${bindir}/share/cups
|
DataDir ${bindir}/share/cups
|
||||||
|
|
||||||
|
@ -286,6 +276,7 @@ in
|
||||||
Order deny,allow
|
Order deny,allow
|
||||||
</Limit>
|
</Limit>
|
||||||
</Policy>
|
</Policy>
|
||||||
|
|
||||||
${cfg.extraConf}
|
${cfg.extraConf}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
propagatedBuildInputs = [ openssl ];
|
propagatedBuildInputs = [ openssl ];
|
||||||
|
|
||||||
configureFlags = "--localstatedir=/var --enable-dbus"; # --with-dbusdir
|
configureFlags = "--localstatedir=/var --sysconfdir=/etc --enable-dbus"; # --with-dbusdir
|
||||||
|
|
||||||
installFlags =
|
installFlags =
|
||||||
[ # Don't try to write in /var at build time.
|
[ # Don't try to write in /var at build time.
|
||||||
|
@ -31,6 +31,7 @@ stdenv.mkDerivation {
|
||||||
"DBUSDIR=$(out)/etc/dbus-1"
|
"DBUSDIR=$(out)/etc/dbus-1"
|
||||||
"INITDIR=$(out)/etc/rc.d"
|
"INITDIR=$(out)/etc/rc.d"
|
||||||
"XINETD=$(out)/etc/xinetd.d"
|
"XINETD=$(out)/etc/xinetd.d"
|
||||||
|
"SERVERROOT=$(out)/etc/cups"
|
||||||
# Idem for /usr.
|
# Idem for /usr.
|
||||||
"MENUDIR=$(out)/share/applications"
|
"MENUDIR=$(out)/share/applications"
|
||||||
"ICONDIR=$(out)/share/icons"
|
"ICONDIR=$(out)/share/icons"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue