19 lines
480 B
Nix
19 lines
480 B
Nix
|
{ config, pkgs, ... }:
|
||
|
|
||
|
let
|
||
|
giteapwd = (builtins.replaceStrings ["\n"] [""] (builtins.readFile /secret/gitea));
|
||
|
in {
|
||
|
services.mysql = {
|
||
|
enable = true;
|
||
|
package = pkgs.mariadb;
|
||
|
initialDatabases = [ {
|
||
|
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};
|
||
|
'';
|
||
|
} ];
|
||
|
};
|
||
|
}
|