hosts/shinmyoumaru: Changed IP

This commit is contained in:
kat witch 2021-09-05 19:14:08 +01:00
parent 15f61b38c2
commit 284681cb1c
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
2 changed files with 27 additions and 29 deletions

View file

@ -20,7 +20,7 @@
type = "resource";
connection = {
port = head config.services.openssh.ports;
host = "192.168.1.145"; #config.network.addresses.private.nixos.ipv4.address;
host = config.network.addresses.private.nixos.ipv4.address;
};
};
};

View file

@ -48,36 +48,34 @@ in
default = {};
};
};
config =
let
localCheck = dbcfg.local && dbcfg.enable && dbcfg.host == "localhost";
postgresCheck = localCheck && dbcfg.type == "postgres";
mysqlCheck = localCheck && dbcfg.type == "mysql";
in
mkIf cfg.enable {
services.glauth.settings = mkIf cfg.database.enable {
backend =
let
pluginHandlers = {
"mysql" = "NewMySQLHandler";
"postgres" = "NewPostgresHandler";
"sqlite" = "NewSQLiteHandler";
};
in
{
datastore = "plugin";
plugin = "${cfg.package}/bin/${dbcfg.type}.so";
pluginhandler = pluginHandlers.${dbcfg.type};
database = if (dbcfg.type != "sqlite") then (builtins.replaceStrings (singleton "\n") (singleton " ") ''
host=${dbcfg.host}
port=${toString dbcfg.port}
dbname=glauth
user=${dbcfg.username}
password=@db-password@
sslmode=${if dbcfg.ssl then "enable" else "disable"}
'') else "database = \"gl.db\"";
config = let
localCheck = dbcfg.local && dbcfg.enable && dbcfg.host == "localhost";
postgresCheck = localCheck && dbcfg.type == "postgres";
mysqlCheck = localCheck && dbcfg.type == "mysql";
in mkIf cfg.enable {
services.glauth.settings = mkIf cfg.database.enable {
backend =
let
pluginHandlers = {
"mysql" = "NewMySQLHandler";
"postgres" = "NewPostgresHandler";
"sqlite" = "NewSQLiteHandler";
};
in
{
datastore = "plugin";
plugin = "${cfg.package}/bin/${dbcfg.type}.so";
pluginhandler = pluginHandlers.${dbcfg.type};
database = if (dbcfg.type != "sqlite") then (builtins.replaceStrings (singleton "\n") (singleton " ") ''
host=${dbcfg.host}
port=${toString dbcfg.port}
dbname=glauth
user=${dbcfg.username}
password=@db-password@
sslmode=${if dbcfg.ssl then "enable" else "disable"}
'') else "database = \"gl.db\"";
};
};
systemd.services.glauthPostgreSQLInit = lib.mkIf postgresCheck {