From 5cd119f65e01dfdc5299010ccb37c87247b2bbff Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 22 Oct 2023 14:14:39 +0200 Subject: [PATCH] add printing and libreoffice --- modules/desktop/default.nix | 10 +++++++--- modules/desktop/printing.nix | 23 +++++++++++++++++++++++ vinzenz-lpt.nix | 1 + vinzenz-pc2.nix | 1 + 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 modules/desktop/printing.nix diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 47fe492..0408581 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -12,6 +12,7 @@ in { ./gnome.nix ./kde.nix ./gaming.nix + ./printing.nix ] ++ lib.optionals isHomeManager [ ./gnome-home.nix @@ -22,9 +23,6 @@ in { config = lib.mkIf isEnabled { services = { - # Enable CUPS to print documents. - printing.enable = true; - xserver = { # Enable the X11 windowing system / wayland depending on DE enable = true; @@ -86,6 +84,12 @@ in { environment = { systemPackages = with pkgs; [ lm_sensors + + # office + libreoffice-qt + hunspell + hunspellDicts.de-de + hunspellDicts.en-us-large ]; }; diff --git a/modules/desktop/printing.nix b/modules/desktop/printing.nix new file mode 100644 index 0000000..5f958aa --- /dev/null +++ b/modules/desktop/printing.nix @@ -0,0 +1,23 @@ +{ + config, + pkgs, + lib, + ... +}: let + isEnabled = config.my.desktop.enablePrinting; +in { + options.my.desktop.enablePrinting = lib.mkEnableOption "printing"; + + config = lib.mkIf isEnabled { + services = { + # Enable CUPS to print documents. + printing.enable = true; + + avahi = { + enable = true; # runs the Avahi daemon + nssmdns = true; # enables the mDNS NSS plug-in + openFirewall = true; # opens the firewall for UDP port 5353 + }; + }; + }; +} diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index e184e77..1d04d75 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -12,6 +12,7 @@ desktop = { enableGnome = true; enableGaming = true; + enablePrinting = true; }; }; diff --git a/vinzenz-pc2.nix b/vinzenz-pc2.nix index 775be57..2d4437c 100644 --- a/vinzenz-pc2.nix +++ b/vinzenz-pc2.nix @@ -12,6 +12,7 @@ desktop = { enableKde = true; enableGaming = true; + enablePrinting = true; }; };