Merge pull request #67585 from worldofpeace/system-config-printer

nixos/system-config-printer: init
This commit is contained in:
worldofpeace 2019-09-06 12:08:23 -04:00 committed by GitHub
commit 5d4890b58d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 110 additions and 9 deletions

View File

@ -144,6 +144,32 @@
but will make sure that the given printers are configured as declared.
</para>
</listitem>
<listitem>
<para>
There is a new <xref linkend="opt-services.system-config-printer.enable"/> and <xref linkend="opt-programs.system-config-printer.enable"/> module
for the program of the same name. If you previously had <literal>system-config-printer</literal> enabled through some other
means you should migrate to using one of these modules.
</para>
<itemizedlist>
<para>If you're a user of the following desktopManager modules no action is needed:</para>
<listitem>
<para><option>services.xserver.desktopManager.plasma5</option></para>
</listitem>
<listitem>
<para><option>services.xserver.desktopManager.gnome3</option></para>
</listitem>
<listitem>
<para><option>services.xserver.desktopManager.pantheon</option></para>
</listitem>
<listitem>
<para><option>services.xserver.desktopManager.mate</option></para>
<para>
Note Mate uses <literal>programs.system-config-printer</literal> as it doesn't
use it as a service, but its graphical interface directly.
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>

View File

@ -151,6 +151,7 @@
./programs/sysdig.nix
./programs/systemtap.nix
./programs/sway.nix
./programs/system-config-printer.nix
./programs/thefuck.nix
./programs/tmux.nix
./programs/tsm-client.nix
@ -309,6 +310,7 @@
./services/desktops/gnome3/tracker.nix
./services/desktops/gnome3/tracker-miners.nix
./services/desktops/profile-sync-daemon.nix
./services/desktops/system-config-printer.nix
./services/desktops/telepathy.nix
./services/desktops/tumbler.nix
./services/desktops/zeitgeist.nix

View File

@ -0,0 +1,32 @@
{ config, pkgs, lib, ... }:
with lib;
{
###### interface
options = {
programs.system-config-printer = {
enable = mkEnableOption "system-config-printer, a Graphical user interface for CUPS administration";
};
};
###### implementation
config = mkIf config.programs.system-config-printer.enable {
environment.systemPackages = [
pkgs.system-config-printer
];
services.system-config-printer.enable = true;
};
}

View File

@ -0,0 +1,38 @@
{ config, pkgs, lib, ... }:
with lib;
{
###### interface
options = {
services.system-config-printer = {
enable = mkEnableOption "system-config-printer, a service for CUPS administration used by printing interfaces";
};
};
###### implementation
config = mkIf config.services.system-config-printer.enable {
services.dbus.packages = [
pkgs.system-config-printer
];
systemd.packages = [
pkgs.system-config-printer
];
services.udev.packages = [
pkgs.system-config-printer
];
};
}

View File

@ -233,10 +233,9 @@ in
services.gnome3.gnome-user-share.enable = mkDefault true;
services.gnome3.rygel.enable = mkDefault true;
services.gvfs.enable = true;
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.telepathy.enable = mkDefault true;
systemd.packages = [ pkgs.gnome3.vino ];
services.dbus.packages =
optional config.services.printing.enable pkgs.system-config-printer;
services.avahi.enable = mkDefault true;

View File

@ -98,6 +98,9 @@ in
programs.bash.vteIntegration = mkDefault true;
programs.zsh.vteIntegration = mkDefault true;
# Mate uses this for printing
programs.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.gnome3.at-spi2-core.enable = true;
services.gnome3.gnome-keyring.enable = true;
services.gnome3.gnome-settings-daemon.enable = true;

View File

@ -113,9 +113,9 @@ in
services.colord.enable = mkDefault true;
services.pantheon.files.enable = mkDefault true;
services.tumbler.enable = mkDefault true;
services.dbus.packages = mkMerge [
([ pkgs.pantheon.switchboard-plug-power ])
(mkIf config.services.printing.enable ([pkgs.system-config-printer]) )
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.dbus.packages = [
pkgs.pantheon.switchboard-plug-power
];
services.pantheon.contractor.enable = mkDefault true;
services.gnome3.at-spi2-core.enable = true;

View File

@ -210,8 +210,7 @@ in
# Enable helpful DBus services.
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
services.dbus.packages =
mkIf config.services.printing.enable [ pkgs.system-config-printer ];
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
# Extra UDEV rules used by Solid
services.udev.packages = [

View File

@ -137,8 +137,7 @@ in
services.gvfs.enable = true;
services.gvfs.package = pkgs.xfce.gvfs;
services.tumbler.enable = true;
services.dbus.packages =
optional config.services.printing.enable pkgs.system-config-printer;
services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
services.xserver.libinput.enable = mkDefault true; # used in xfce4-settings-manager
# Enable default programs

View File

@ -61,6 +61,9 @@ stdenv.mkDerivation rec {
# Manually expand literal "$(out)", which have failed to expand
sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
-i "$out/etc/systemd/system/configure-printer@.service"
substituteInPlace $out/etc/udev/rules.d/70-printers.rules \
--replace "udev-configure-printer" "$out/etc/udev/udev-configure-printer"
'';
meta = {