diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-04-30 14:42:55 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-04-30 15:56:41 +0300 |
commit | 9be6c7b78f2a668aa1edcafa25c3dd1ba8ae6ad7 (patch) | |
tree | 8db0743d00f83406e38e2c2c192751c778fe54c9 /modules/apps/mysqlbackup.nix | |
parent | 49659d55878d09827566902d07d01f051926aff2 (diff) | |
download | nixsap-9be6c7b78f2a668aa1edcafa25c3dd1ba8ae6ad7.tar.gz |
(* BREAKING *) Avoid ambiguous options
"either foo (listOf foo)" was not very useful
and interfered proper merging.
Diffstat (limited to 'modules/apps/mysqlbackup.nix')
-rw-r--r-- | modules/apps/mysqlbackup.nix | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/apps/mysqlbackup.nix b/modules/apps/mysqlbackup.nix index 113d176..811e930 100644 --- a/modules/apps/mysqlbackup.nix +++ b/modules/apps/mysqlbackup.nix @@ -13,7 +13,7 @@ let mysqldump = "${pkgs.mariadb.client.bin}/bin/mysqldump"; s3cmd = "${pkgs.s3cmd}/bin/s3cmd ${optionalString (cfg.s3cfg != null) "-c '${cfg.s3cfg}'"}"; - gpgPubKeys = flatten [ cfg.encrypt ]; + gpgPubKeys = cfg.encrypt; gpg = "${pkgs.gpg}/bin/gpg2"; pubring = pkgs.runCommand "pubring.kbx" {} '' ${gpg} --homedir . --import ${toString gpgPubKeys} @@ -53,8 +53,8 @@ let Databases to dump. MySQL wildcards (_ and %) are supported. Logical OR is applied to all entries. ''; - type = either str (listOf str); - default = "%"; + type = listOf str; + default = [ "%" ]; example = [ "%\\_live\\_%" ]; }; not-like = mkOption { @@ -63,7 +63,7 @@ let You don't need to specify `performance_schema` or `information_schema` here, they are always ignored. Logical AND is applied to all entries. ''; - type = either str (listOf str); + type = listOf str; default = []; example = [ "tmp\\_%" "snap\\_%" ]; }; @@ -74,7 +74,7 @@ let Each table template can be prefixed with a database template. In that case it will be applied to matching databases only, instead of all databases''; - type = either str (listOf str); + type = listOf str; default = []; example = [ "bob%.alice\\_message" ]; }; @@ -84,7 +84,7 @@ let Each table template can be prefixed with a database template. In that case it will be applied to matching databases only, instead of all databases''; - type = either str (listOf str); + type = listOf str; default = []; example = [ "tmp%" "%\\_backup" ]; }; @@ -103,8 +103,8 @@ let showDatabases = name: server: pkgs.writeText "show-databases-${name}.sql" '' SHOW DATABASES WHERE `Database` NOT IN ('information_schema', 'performance_schema', 'tmp', 'innodb') - AND (${concatMapStringsSep " OR " (e: "`Database` LIKE '${e}'") (flatten [server.databases.like])}) - ${concatMapStringsSep " " (e: "AND `Database` NOT LIKE '${e}'") (flatten [server.databases.not-like])} + AND (${concatMapStringsSep " OR " (e: "`Database` LIKE '${e}'") server.databases.like}) + ${concatMapStringsSep " " (e: "AND `Database` NOT LIKE '${e}'") server.databases.not-like} ; ''; @@ -378,7 +378,7 @@ in { encrypt = mkOption { description = "Public GPG key(s) for encrypting the dumps"; default = [ ]; - type = either path (listOf path); + type = listOf path; }; servers = mkOption { |