mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 14:11:36 +00:00
nixos/service.tt-rss: improve mysql automatic setup
If the user chooses MySQL, it is enabled by default. Also, the used database is created automatically along with the user and permissions.
This commit is contained in:
parent
68855595ce
commit
c26ff43905
|
@ -557,6 +557,20 @@ let
|
|||
after = ["network.target" "${dbService}"];
|
||||
};
|
||||
|
||||
services.mysql = optionalAttrs (cfg.database.type == "mysql") {
|
||||
enable = true;
|
||||
package = mkDefault pkgs.mariadb;
|
||||
ensureDatabases = [ cfg.database.name ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = cfg.user;
|
||||
ensurePermissions = {
|
||||
"${cfg.database.name}.*" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
users = optionalAttrs (cfg.user == "tt_rss") {
|
||||
extraUsers = singleton {
|
||||
name = "tt_rss";
|
||||
|
|
Loading…
Reference in a new issue