Modularized configuration now kind of works. (still need to do some refactoring)

This commit is contained in:
Kevin Baensch 2019-03-20 02:57:59 +01:00
parent a0f361425a
commit 14332b2c7b
24 changed files with 144 additions and 85 deletions

View file

@ -1,12 +1,14 @@
{ config, pkgs, ... }:
{ config, lib, pkgs, ... }:
with lib;
let
giteapwd = (builtins.replaceStrings ["\n"] [""] (builtins.readFile /secret/gitea));
in {
giteapwd = if config.services.gitea.enable then (builtins.readFile /secret/gitea) else "";
in mkIf (elem "mariaDB" config.machine.services) {
services.mysql = {
enable = true;
package = pkgs.mariadb;
initialDatabases = [ {
initialDatabases = [ mkIf config.services.gitea.enable {
name = "gitea";
schema = pkgs.writeText "gitea.sql"
''
@ -16,3 +18,4 @@ in {
} ];
};
}