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

Sandro e2adef4c a7a5e224

Changed files
+11 -2
nixos
modules
services
+11 -2
nixos/modules/services/misc/paperless.nix
···
}:
let
cfg = config.services.paperless;
defaultUser = "paperless";
defaultFont = "${pkgs.liberation_ttf}/share/fonts/truetype/LiberationSerif-Regular.ttf";
···
};
domain = lib.mkOption {
-
type = lib.types.str;
example = "paperless.example.com";
description = "Domain under which paperless will be available.";
};
···
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
services.paperless.manage = manage;
environment.systemPackages = [ manage ];
···
};
services.paperless.settings = lib.mkMerge [
-
(lib.mkIf (cfg.domain != "") {
PAPERLESS_URL = "https://${cfg.domain}";
})
(lib.mkIf cfg.database.createLocally {
···
}:
let
cfg = config.services.paperless;
+
opt = options.services.paperless;
defaultUser = "paperless";
defaultFont = "${pkgs.liberation_ttf}/share/fonts/truetype/LiberationSerif-Regular.ttf";
···
};
domain = lib.mkOption {
+
type = with lib.types; nullOr str;
+
default = null;
example = "paperless.example.com";
description = "Domain under which paperless will be available.";
};
···
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
+
assertions = [
+
{
+
assertion = cfg.configureNginx -> cfg.domain != null;
+
message = "${opt.configureNginx} requires ${opt.domain} to be configured.";
+
}
+
];
+
services.paperless.manage = manage;
environment.systemPackages = [ manage ];
···
};
services.paperless.settings = lib.mkMerge [
+
(lib.mkIf (cfg.domain != null) {
PAPERLESS_URL = "https://${cfg.domain}";
})
(lib.mkIf cfg.database.createLocally {