Fresh repo without sensitive data.

This commit is contained in:
Kevin Baensch 2019-02-26 13:44:40 +01:00
commit 9003080a64
44 changed files with 2039 additions and 0 deletions

27
services/mariaDB.nix Normal file
View 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};
'';
} ];
};
}