[NixOS] Add postgres configuration

This commit is contained in:
Ivan Malison 2024-01-03 13:45:20 -07:00
parent a75824ee2a
commit 18ef010bf1
3 changed files with 21 additions and 0 deletions

View File

@ -24,6 +24,7 @@
./nixified.ai.nix
./options.nix
./plasma.nix
./postgres.nix
./secrets.nix
./ssh.nix
./syncthing.nix

View File

@ -13,6 +13,7 @@
port = 3090;
};
modules.gitea-runner.enable = true;
modules.postgres.enable = true;
boot.loader.systemd-boot.configurationLimit = 5;

19
nixos/postgres.nix Normal file
View File

@ -0,0 +1,19 @@
{ pkgs, config, makeEnable, ... }:
makeEnable config "modules.postgres" false {
services.postgresql = {
enable = true;
package = pkgs.postgresql_15;
ensureDatabases = [ "railbird" "public" ];
authentication = pkgs.lib.mkOverride 10 ''
#type database DBuser CIDR-ADDRESS auth-method
local all all trust
host all all 0.0.0.0/0 trust
host all all ::1/128 trust
'';
};
services.pgadmin = {
enable = true;
initialEmail = "IvanMalison@gmail.com";
initialPasswordFile = (builtins.toFile "password" "This is the content of the file.");
};
}