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