feat: added postgresql
This commit is contained in:
parent
6922232ec5
commit
9320bd758a
4 changed files with 43 additions and 19 deletions
|
@ -2,12 +2,12 @@
|
||||||
imports = [
|
imports = [
|
||||||
./boot.nix
|
./boot.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
../../modules/game/server/luanti
|
||||||
|
|
||||||
../../system_profiles/defaults.nix
|
../../system_profiles/defaults.nix
|
||||||
../../system_profiles/mini.nix
|
../../system_profiles/mini.nix
|
||||||
../../system_profiles/server.nix
|
../../system_profiles/server.nix
|
||||||
|
|
||||||
../../modules/game/server/luanti
|
|
||||||
../../modules/sec_auth/ssh-server.nix
|
../../modules/sec_auth/ssh-server.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,6 @@
|
||||||
{pkgs, ...}: let
|
{
|
||||||
port = 10523;
|
imports = [
|
||||||
in {
|
./luanti.nix
|
||||||
services.minetest-server = {
|
./postgresql.nix
|
||||||
enable = true;
|
|
||||||
|
|
||||||
gameId = "asuna";
|
|
||||||
port = port;
|
|
||||||
};
|
|
||||||
|
|
||||||
# open port since luanti does not do it by itself
|
|
||||||
networking.firewall = {
|
|
||||||
allowedUDPPorts = [port];
|
|
||||||
};
|
|
||||||
|
|
||||||
# install luanti seperatly so it is available through the command line
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
luanti
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
20
modules/game/server/luanti/luanti.nix
Normal file
20
modules/game/server/luanti/luanti.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{pkgs, ...}: let
|
||||||
|
port = 10523;
|
||||||
|
in {
|
||||||
|
services.minetest-server = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
gameId = "asuna";
|
||||||
|
port = port;
|
||||||
|
};
|
||||||
|
|
||||||
|
# open port since luanti does not do it by itself
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [port];
|
||||||
|
};
|
||||||
|
|
||||||
|
# install luanti seperatly so it is available through the command line
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
luanti
|
||||||
|
];
|
||||||
|
}
|
18
modules/game/server/luanti/postgresql.nix
Normal file
18
modules/game/server/luanti/postgresql.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
config.services.postgresql = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
authentication = pkgs.lib.mkOverride 10 ''
|
||||||
|
#type database DBuser auth-method
|
||||||
|
local all all trust
|
||||||
|
'';
|
||||||
|
|
||||||
|
ensureDatabases = ["luanti_world"];
|
||||||
|
ensureUsers = [
|
||||||
|
{
|
||||||
|
name = "luanti_world";
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue