# roles/thin-client/apps/office-web.nix # # Office 365 (cloud) web apps as Chromium app-mode .desktop files. # Q11 decisions: Word, Excel, PowerPoint, Outlook, Teams via # `chromium --app=`, system-wide, Outlook+Teams autostart at login. # # The .desktop files are installed system-wide via # environment.systemPackages, so every user sees them in the KDE menu # under "Office". {config, lib, pkgs, ...}: let inherit (lib) mkIf; cfg = config.az.tc; # Helper: builds a Chromium app-mode .desktop file. mkOfficeWebDesktop = name: url: comment: pkgs.writeTextFile { name = builtins.replaceStrings [" "] ["-"] (lib.toLower name) + ".desktop"; destination = "/share/applications/${builtins.replaceStrings [" "] ["-"] (lib.toLower name)}.desktop"; text = '' [Desktop Entry] Version=1.0 Type=Application Name=${name} GenericName=${name} (Web) Comment=${comment} Exec=${pkgs.chromium}/bin/chromium --app=${url} --no-default-browser-check --no-first-run Icon=web-browser Terminal=false Categories=Office;Network;WebApps; Keywords=office;${lib.toLower name};web; StartupNotify=true StartupWMClass=${url} ''; }; in { config = mkIf cfg.enable { environment.systemPackages = [ (mkOfficeWebDesktop "Word" "https://www.office.com/launch/word" "Microsoft Word Online") (mkOfficeWebDesktop "Excel" "https://www.office.com/launch/excel" "Microsoft Excel Online") (mkOfficeWebDesktop "PowerPoint" "https://www.office.com/launch/powerpoint" "Microsoft PowerPoint Online") (mkOfficeWebDesktop "Outlook" "https://outlook.office.com" "Microsoft Outlook Web") (mkOfficeWebDesktop "Teams" "https://teams.microsoft.com" "Microsoft Teams Web") ]; }; }