diff --git a/modules/common/services/default.nix b/modules/common/services/default.nix index 73795c0ac2..37b098357c 100644 --- a/modules/common/services/default.nix +++ b/modules/common/services/default.nix @@ -10,5 +10,6 @@ ./pdfopen.nix ./namespaces.nix ./yubikey.nix + ./printer.nix ]; } diff --git a/modules/common/services/printer.nix b/modules/common/services/printer.nix new file mode 100644 index 0000000000..667c83a92f --- /dev/null +++ b/modules/common/services/printer.nix @@ -0,0 +1,54 @@ +# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors +# SPDX-License-Identifier: Apache-2.0 +{ config, lib, ... }: +let + cfg = config.ghaf.services.printer; + inherit (lib) mkIf mkEnableOption; +in +{ + options.ghaf.services.printer = { + enable = mkEnableOption "Printer configuration for app-vms"; + }; + config = mkIf cfg.enable { + + services.printing.enable = true; + services.avahi = { + enable = true; + nssmdns4 = true; + reflector = true; + }; + environment.etc."chromium/bookmarks.html".text = + '' + + + +
+
+ '' + + "
+
+ ''; + programs.chromium.initialPrefs = { + "import_bookmarks" = false; + "distribution" = { + "import_bookmarks" = false; + "import_bookmarks_from_file" = "/etc/chromium/bookmarks.html"; + "bookmark_bar" = { + "show_on_all_tabs" = true; + }; + }; + }; + }; +} diff --git a/modules/reference/appvms/business.nix b/modules/reference/appvms/business.nix index 60ffaca37b..6c0a16dfb7 100644 --- a/modules/reference/appvms/business.nix +++ b/modules/reference/appvms/business.nix @@ -99,12 +99,8 @@ in # Set default PDF XDG handler xdg.mime.defaultApplications."application/pdf" = "ghaf-pdf.desktop"; - services.printing.enable = true; - services.avahi = { - enable = true; - nssmdns4 = true; - reflector = true; - }; + # Enable printer service + ghaf.services.printer.enable = true; # TODO: Add a way to configure the gpclient # also check the openconnect cli options https://discourse.nixos.org/t/globalprotect-vpn/24014/5 diff --git a/modules/reference/appvms/chromium.nix b/modules/reference/appvms/chromium.nix index c7b289b861..8cad12de9e 100644 --- a/modules/reference/appvms/chromium.nix +++ b/modules/reference/appvms/chromium.nix @@ -90,12 +90,8 @@ in # Set default PDF XDG handler xdg.mime.defaultApplications."application/pdf" = "ghaf-pdf.desktop"; - services.printing.enable = true; - services.avahi = { - enable = true; - nssmdns4 = true; - reflector = true; - }; + # Enable printer service + ghaf.services.printer.enable = true; } ]; borderColor = "#630505"; diff --git a/overlays/custom-packages/cups/default.nix b/overlays/custom-packages/cups/default.nix index c71773c29f..497064f468 100644 --- a/overlays/custom-packages/cups/default.nix +++ b/overlays/custom-packages/cups/default.nix @@ -3,7 +3,7 @@ { final, prev }: prev.cups.overrideAttrs ( _final: _prev: { - version = "17.5.229"; + # Due to the incorrect printer URI bug: https://github.com/OpenPrinting/cups/issues/998 src = final.fetchFromGitHub { owner = "OpenPrinting"; repo = "cups";