change module settings option format

This commit is contained in:
Jonas Heinrich 2025-03-12 12:21:44 +01:00
parent 462ccfbc72
commit e3270ca7b1

View file

@ -1,7 +1,4 @@
{config, lib, pkgs, ...}: {config, lib, pkgs, ...}:
with lib;
let let
cfg = config.services.eintopf-radar-sync; cfg = config.services.eintopf-radar-sync;
@ -12,28 +9,28 @@ in
options = { options = {
services.eintopf-radar-sync = { services.eintopf-radar-sync = {
enable = mkOption { enable = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = '' description = ''
Enable eintopf-radar-sync daemon. Enable eintopf-radar-sync daemon.
''; '';
}; };
settings = mkOption { settings = lib.mkOption {
type = types.submodule { type = lib.types.submodule {
freeformType = jsonFormat.type; freeformType = with lib.types; attrsOf types.str;
options = { options = {
EINTOPF_URL = mkOption { EINTOPF_URL = lib.mkOption {
default = ""; default = "";
type = types.str; type = lib.types.str;
description = '' description = ''
Base URL of the target Eintopf host. Base URL of the target Eintopf host.
''; '';
}; };
RADAR_GROUP_ID = mkOption { RADAR_GROUP_ID = lib.mkOption {
default = ""; default = "";
type = types.str; type = lib.types.str;
description = '' description = ''
Radar group ID which events to sync. Radar group ID which events to sync.
''; '';
@ -44,7 +41,7 @@ in
description = '' description = ''
Extra options which should be used by the Radar sync script. Extra options which should be used by the Radar sync script.
''; '';
example = literalExpression '' example = lib.literalExpression ''
{ {
EINTOPF_URL = "eintopf.info"; EINTOPF_URL = "eintopf.info";
RADAR_GROUP_ID = "436012"; RADAR_GROUP_ID = "436012";
@ -53,7 +50,7 @@ in
}; };
secrets = lib.mkOption { secrets = lib.mkOption {
type = with types; listOf path; type = with lib.types; listOf path;
description = '' description = ''
A list of files containing the various secrets. Should be in the A list of files containing the various secrets. Should be in the
format expected by systemd's `EnvironmentFile` directory. format expected by systemd's `EnvironmentFile` directory.
@ -75,7 +72,7 @@ in
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
systemd.services."eintopf-radar-sync" = { systemd.services."eintopf-radar-sync" = {
description = "eintopf-radar-sync script"; description = "eintopf-radar-sync script";