nixos/znc-service: don't use types.string (it's deprecated)

Apart from s/types.string/types.str/ (or types.lines where appropriate):

* port is changed from string to int.

* extraFlags is changed from types.string (with unfortunate merge
  semantics) into a list of strings. A list of strings merge better:
  one space is added between elements.
This commit is contained in:
Bjørn Forsman 2014-07-13 20:27:19 +02:00
parent a9858101bc
commit 3a4498ab07

View File

@ -23,7 +23,7 @@ let
confOptions = { ... }: {
options = {
modules = mkOption {
type = types.listOf types.string;
type = types.listOf types.str;
default = [ "partyline" "webadmin" "adminlog" "log" ];
example = [ "partyline" "webadmin" "adminlog" "log" ];
description = ''
@ -34,7 +34,7 @@ let
userName = mkOption {
default = defaultUserName;
example = "johntron";
type = types.string;
type = types.str;
description = ''
The user name to use when generating the `znc.conf` file.
This is the user name used by the user logging into the ZNC web admin.
@ -44,7 +44,7 @@ let
nick = mkOption {
default = "znc-user";
example = "john";
type = types.string;
type = types.str;
description = ''
The IRC nick to use when generating the `znc.conf` file.
'';
@ -53,7 +53,7 @@ let
passBlock = mkOption {
default = defaultPassBlock;
example = "Must be the block generated by the `znc --makepass` command.";
type = types.string;
type = types.str;
description = ''
The pass block to use when generating the `znc.conf` file.
This is the password used by the user logging into the ZNC web admin.
@ -63,9 +63,9 @@ let
};
port = mkOption {
default = "5000";
example = "5000";
type = types.string;
default = 5000;
example = 5000;
type = types.int;
description = ''
Specifies the port on which to listen.
'';
@ -104,7 +104,7 @@ let
AllowWeb = true
IPv4 = true
IPv6 = false
Port = ${if confOpts.useSSL then "+" else ""}${confOpts.port}
Port = ${if confOpts.useSSL then "+" else ""}${toString confOpts.port}
SSL = ${if confOpts.useSSL then "true" else "false"}
</Listener>
@ -160,7 +160,7 @@ in
user = mkOption {
default = "znc";
example = "john";
type = types.string;
type = types.str;
description = ''
The name of an existing user account to use to own the ZNC server process.
If not specified, a default user will be created to own the process.
@ -170,7 +170,7 @@ in
dataDir = mkOption {
default = "/home/${cfg.user}/.znc";
example = "/home/john/.znc";
type = types.string;
type = types.path;
description = ''
The data directory. Used for configuration files and modules.
'';
@ -179,7 +179,7 @@ in
zncConf = mkOption {
default = "";
example = "See: http://wiki.znc.in/Configuration";
type = types.string;
type = types.lines;
description = ''
The contents of the `znc.conf` file to use when creating it.
If specified, `confOptions` will be ignored, and this value, as-is, will be used.
@ -218,9 +218,9 @@ in
};
extraFlags = mkOption {
default = "";
example = "--debug";
type = types.string;
default = [ ];
example = [ "--debug" ];
type = types.listOf types.str;
description = ''
Extra flags to use when executing znc command.
'';
@ -272,7 +272,7 @@ in
${pkgs.znc}/bin/znc --makepem
fi
'';
script = "${pkgs.znc}/bin/znc --foreground --datadir ${cfg.dataDir} ${cfg.extraFlags}";
script = "${pkgs.znc}/bin/znc --foreground --datadir ${cfg.dataDir} ${toString cfg.extraFlags}";
};
users.extraUsers = optional (cfg.user == defaultUser)