nixos/paperless: add missing default to domain (#439217)

authored by Sandro and committed by GitHub e2adef4c a7a5e224

+11 -2
+11 -2
nixos/modules/services/misc/paperless.nix
··· 7 7 }: 8 8 let 9 9 cfg = config.services.paperless; 10 + opt = options.services.paperless; 10 11 11 12 defaultUser = "paperless"; 12 13 defaultFont = "${pkgs.liberation_ttf}/share/fonts/truetype/LiberationSerif-Regular.ttf"; ··· 328 329 }; 329 330 330 331 domain = lib.mkOption { 331 - type = lib.types.str; 332 + type = with lib.types; nullOr str; 333 + default = null; 332 334 example = "paperless.example.com"; 333 335 description = "Domain under which paperless will be available."; 334 336 }; ··· 387 389 config = lib.mkIf cfg.enable ( 388 390 lib.mkMerge [ 389 391 { 392 + assertions = [ 393 + { 394 + assertion = cfg.configureNginx -> cfg.domain != null; 395 + message = "${opt.configureNginx} requires ${opt.domain} to be configured."; 396 + } 397 + ]; 398 + 390 399 services.paperless.manage = manage; 391 400 environment.systemPackages = [ manage ]; 392 401 ··· 425 434 }; 426 435 427 436 services.paperless.settings = lib.mkMerge [ 428 - (lib.mkIf (cfg.domain != "") { 437 + (lib.mkIf (cfg.domain != null) { 429 438 PAPERLESS_URL = "https://${cfg.domain}"; 430 439 }) 431 440 (lib.mkIf cfg.database.createLocally {