nixos/spacecookie: reflect changes for spacecookie 1.0.0.0
* New log options * The old port option has been deprecated in favor of listen -> port https://github.com/sternenseemann/spacecookie/blob/master/CHANGELOG.md#1000
This commit is contained in:
parent
76583ee81a
commit
d51edbe17e
@ -6,7 +6,9 @@ let
|
|||||||
cfg = config.services.spacecookie;
|
cfg = config.services.spacecookie;
|
||||||
|
|
||||||
spacecookieConfig = {
|
spacecookieConfig = {
|
||||||
|
listen = {
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
} // cfg.settings;
|
} // cfg.settings;
|
||||||
|
|
||||||
format = pkgs.formats.json {};
|
format = pkgs.formats.json {};
|
||||||
@ -87,13 +89,53 @@ in {
|
|||||||
<literal>DynamicUser=true</literal>.
|
<literal>DynamicUser=true</literal>.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options.log = {
|
||||||
|
enable = mkEnableOption "logging for spacecookie"
|
||||||
|
// { default = true; example = false; };
|
||||||
|
|
||||||
|
hide-ips = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
If enabled, spacecookie will hide personal
|
||||||
|
information of users like IP addresses from
|
||||||
|
log output.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
hide-time = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
# since we are starting with systemd anyways
|
||||||
|
# we deviate from the default behavior here:
|
||||||
|
# journald will add timestamps, so no need
|
||||||
|
# to double up.
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
If enabled, spacecookie will not print timestamps
|
||||||
|
at the beginning of every log line.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
level = mkOption {
|
||||||
|
type = types.enum [
|
||||||
|
"info"
|
||||||
|
"warn"
|
||||||
|
"error"
|
||||||
|
];
|
||||||
|
default = "info";
|
||||||
|
description = ''
|
||||||
|
Log level for the spacecookie service.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
description = ''
|
description = ''
|
||||||
Settings for spacecookie. The settings set here are
|
Settings for spacecookie. The settings set here are
|
||||||
directly translated to the spacecookie JSON config
|
directly translated to the spacecookie JSON config
|
||||||
file. See the
|
file. See
|
||||||
<link xlink:href="https://github.com/sternenseemann/spacecookie/#configuration">spacecookie documentation</link>
|
<link xlink:href="https://sternenseemann.github.io/spacecookie/spacecookie.json.5.html">spacecookie.json(5)</link>
|
||||||
for explanations of all options.
|
for explanations of all options.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
@ -116,11 +158,11 @@ in {
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion = !(cfg.settings ? port);
|
assertion = !(cfg.settings ? listen || cfg.settings ? port);
|
||||||
message = ''
|
message = ''
|
||||||
The NixOS spacecookie module uses socket activation,
|
The NixOS spacecookie module uses socket activation,
|
||||||
so the port option has no effect. Use the port option
|
so the listen options have no effect. Use the port
|
||||||
in services.spacecookie instead.
|
and address options in services.spacecookie instead.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user