Fresh repo without sensitive data.
This commit is contained in:
commit
9003080a64
44 changed files with 2039 additions and 0 deletions
27
services/mariaDB.nix
Normal file
27
services/mariaDB.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
nextcloudpwd = (builtins.replaceStrings ["\n"] [""] (builtins.readFile /secret/nextcloud_db));
|
||||
giteapwd = (builtins.replaceStrings ["\n"] [""] (builtins.readFile /secret/gitea));
|
||||
in {
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb;
|
||||
initialDatabases = [ {
|
||||
name = "nextcloud";
|
||||
schema = pkgs.writeText "nextcloud.sql"
|
||||
''
|
||||
create user if not exists 'nextcloud'@'localhost' identified by ${nextcloudpwd};
|
||||
grant all privileges on nextcloud.* to 'nextcloud'@'localhost' identified by ${nextcloudpwd};
|
||||
'';
|
||||
}
|
||||
{
|
||||
name = "gitea";
|
||||
schema = pkgs.writeText "gitea.sql"
|
||||
''
|
||||
create user if not exists 'git'@'localhost' identified by ${giteapwd};
|
||||
grant all privileges on gitea.* to 'git'@'localhost' identified by ${giteapwd};
|
||||
'';
|
||||
} ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue