···258258- `services.paperless` now installs `paperless-manage` as a normal system package instead of creating a symlink in `/var/lib/paperless`.259259 `paperless-manage` now also changes to the appropriate user when being executed.260260261261+- The `gotenberg` package has been updated to 8.16.0, which brings breaking changes to the configuration from version 8.13.0. See the [upstream release notes](https://github.com/gotenberg/gotenberg/releases/tag/v8.13.0)262262+ for that release to get all the details. The `services.gotenberg` module has been updated appropriately to ensure your configuration is valid with this new release.263263+261264- `asusd` has been upgraded to version 6 which supports multiple aura devices. To account for this, the single `auraConfig` configuration option has been replaced with `auraConfigs` which is an attribute set of config options per each device. The config files may also be now specified as either source files or text strings; to account for this you will need to specify that `text` is used for your existing configs, e.g.:262265 ```diff263266 -services.asusd.asusdConfig = '''file contents'''
+120-22
nixos/modules/services/misc/gotenberg.nix
···1616 "--chromium-max-queue-size=${toString cfg.chromium.maxQueueSize}"1717 "--libreoffice-restart-after=${toString cfg.libreoffice.restartAfter}"1818 "--libreoffice-max-queue-size=${toString cfg.libreoffice.maxQueueSize}"1919- "--pdfengines-engines=${lib.concatStringsSep "," cfg.pdfEngines}"1919+ "--pdfengines-merge-engines=${lib.concatStringsSep "," cfg.pdfEngines.merge}"2020+ "--pdfengines-convert-engines=${lib.concatStringsSep "," cfg.pdfEngines.convert}"2121+ "--pdfengines-read-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.readMetadata}"2222+ "--pdfengines-write-metadata-engines=${lib.concatStringsSep "," cfg.pdfEngines.writeMetadata}"2323+ "--api-download-from-allow-list=${cfg.downloadFrom.allowList}"2424+ "--api-download-from-max-retry=${toString cfg.downloadFrom.maxRetries}"2025 ]2126 ++ optional cfg.enableBasicAuth "--api-enable-basic-auth"2227 ++ optional cfg.chromium.autoStart "--chromium-auto-start"2328 ++ optional cfg.chromium.disableJavascript "--chromium-disable-javascript"2429 ++ optional cfg.chromium.disableRoutes "--chromium-disable-routes"2530 ++ optional cfg.libreoffice.autoStart "--libreoffice-auto-start"2626- ++ optional cfg.libreoffice.disableRoutes "--libreoffice-disable-routes";3131+ ++ optional cfg.libreoffice.disableRoutes "--libreoffice-disable-routes"3232+ ++ optional cfg.pdfEngines.disableRoutes "--pdfengines-disable-routes"3333+ ++ optional (3434+ cfg.downloadFrom.denyList != null3535+ ) "--api-download-from-deny-list=${cfg.downloadFrom.denyList}"3636+ ++ optional cfg.downloadFrom.disable "--api-disable-download-from"3737+ ++ optional (cfg.bodyLimit != null) "--api-body-limit=${cfg.bodyLimit}"3838+ ++ lib.optionals (cfg.extraArgs != [ ]) cfg.extraArgs;27392840 inherit (lib)2941 mkEnableOption···6351 description = "Port on which the API should listen.";6452 };65535454+ bindIP = mkOption {5555+ type = types.nullOr types.str;5656+ default = "127.0.0.1";5757+ description = "Port the API listener should bind to. Set to 0.0.0.0 to listen on all available IPs.";5858+ };5959+6660 timeout = mkOption {6761 type = types.nullOr types.str;6862 default = "30s";···9072 If you set this, be sure to set `GOTENBERG_API_BASIC_AUTH_USERNAME`and `GOTENBERG_API_BASIC_AUTH_PASSWORD`9173 in your `services.gotenberg.environmentFile` file.9274 '';7575+ };7676+7777+ bodyLimit = mkOption {7878+ type = types.nullOr types.str;7979+ default = null;8080+ description = "Sets the max limit for `multipart/form-data` requests. Accepts values like '5M', '20G', etc.";9381 };94829583 extraFontPackages = mkOption {···132108 };133109 };134110111111+ downloadFrom = {112112+ allowList = mkOption {113113+ type = types.nullOr types.str;114114+ default = ".*";115115+ description = "Allow these URLs to be used in the `downloadFrom` API field. Accepts a regular expression.";116116+ };117117+ denyList = mkOption {118118+ type = types.nullOr types.str;119119+ default = null;120120+ description = "Deny accepting URLs from these domains in the `downloadFrom` API field. Accepts a regular expression.";121121+ };122122+ maxRetries = mkOption {123123+ type = types.int;124124+ default = 4;125125+ description = "The maximum amount of times to retry downloading a file specified with `downloadFrom`.";126126+ };127127+ disable = mkOption {128128+ type = types.bool;129129+ default = false;130130+ description = "Whether to disable the ability to download files for conversion from outside sources.";131131+ };132132+ };133133+135134 libreoffice = {136135 package = mkPackageOption pkgs "libreoffice" { };137136···183136 };184137 };185138186186- pdfEngines = mkOption {187187- type = types.listOf (188188- types.enum [189189- "pdftk"139139+ pdfEngines = {140140+ merge = mkOption {141141+ type = types.listOf (142142+ types.enum [143143+ "qpdf"144144+ "pdfcpu"145145+ "pdftk"146146+ ]147147+ );148148+ default = [190149 "qpdf"191191- "libreoffice-pdfengine"192192- "exiftool"193150 "pdfcpu"194194- ]195195- );196196- default = [197197- "pdftk"198198- "qpdf"199199- "libreoffice-pdfengine"200200- "exiftool"201201- "pdfcpu"202202- ];203203- description = ''204204- PDF engines to enable. Each one can be used to perform a specific task.205205- See [the documentation](https://gotenberg.dev/docs/configuration#pdf-engines) for more details.206206- Defaults to all possible PDF engines.207207- '';151151+ "pdftk"152152+ ];153153+ description = "PDF Engines to use for merging files.";154154+ };155155+ convert = mkOption {156156+ type = types.listOf (157157+ types.enum [158158+ "libreoffice-pdfengine"159159+ ]160160+ );161161+ default = [162162+ "libreoffice-pdfengine"163163+ ];164164+ description = "PDF Engines to use for converting files.";165165+ };166166+ readMetadata = mkOption {167167+ type = types.listOf (168168+ types.enum [169169+ "exiftool"170170+ ]171171+ );172172+ default = [173173+ "exiftool"174174+ ];175175+ description = "PDF Engines to use for reading metadata from files.";176176+ };177177+ writeMetadata = mkOption {178178+ type = types.listOf (179179+ types.enum [180180+ "exiftool"181181+ ]182182+ );183183+ default = [184184+ "exiftool"185185+ ];186186+ description = "PDF Engines to use for writing metadata to files.";187187+ };188188+189189+ disableRoutes = mkOption {190190+ type = types.bool;191191+ default = false;192192+ description = "Disable routes related to PDF engines.";193193+ };208194 };209195210196 logLevel = mkOption {···276196 See `services.gotenberg.enableBasicAuth` for the names of those variables.277197 '';278198 }199199+ {200200+ assertion = !(lib.isList cfg.pdfEngines);201201+ message = ''202202+ Setting `services.gotenberg.pdfEngines` to a list is now deprecated.203203+ Use the new `pdfEngines.mergeEngines`, `pdfEngines.convertEngines`, `pdfEngines.readMetadataEngines`, and `pdfEngines.writeMetadataEngines` settings instead.204204+205205+ The previous option was using a method that is now deprecated by upstream.206206+ '';207207+ }279208 ];280209281210 systemd.services.gotenberg = {···298209 FONTCONFIG_FILE = pkgs.makeFontsConf {299210 fontDirectories = [ pkgs.liberation_ttf_v2 ] ++ cfg.extraFontPackages;300211 };212212+ # Needed for LibreOffice to work correctly.213213+ # https://github.com/NixOS/nixpkgs/issues/349123#issuecomment-2418330936214214+ HOME = "/run/gotenberg";301215 };302216 serviceConfig = {303217 Type = "simple";304218 DynamicUser = true;305219 ExecStart = "${lib.getExe cfg.package} ${lib.escapeShellArgs args}";220220+221221+ # Needed for LibreOffice to work correctly.222222+ # See above issue comment.223223+ WorkingDirectory = "/run/gotenberg";224224+ RuntimeDirectory = "gotenberg";306225307226 # Hardening options308227 PrivateDevices = true;···340243 SystemCallFilter = [341244 "@sandbox"342245 "@system-service"246246+ "@chown"343247 ];344248 SystemCallArchitectures = "native";345249