Added: Postgrest
This commit is contained in:
@@ -34,5 +34,6 @@
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kubectl
|
||||
kubernetes-helm
|
||||
];
|
||||
}
|
||||
|
||||
@@ -61,9 +61,52 @@
|
||||
};
|
||||
|
||||
# Enable the PostgreSQL service to start on boot
|
||||
systemd.services.postgresql.wantedBy = [ "multi-user.target" ];
|
||||
systemd.services = {
|
||||
postgresql.wantedBy = [ "multi-user.target" ];
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 5432 ];
|
||||
postgrest = {
|
||||
description = "PostgREST - PostgreSQL REST API";
|
||||
after = [
|
||||
"postgresql.service"
|
||||
"network.target"
|
||||
];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.postgrest}/bin/postgrest /etc/postgrest/postgrest.conf";
|
||||
User = "postgrest";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users = {
|
||||
users.postgrest = {
|
||||
isSystemUser = true;
|
||||
group = "postgrest";
|
||||
};
|
||||
groups.postgrest = { };
|
||||
};
|
||||
|
||||
# PostgREST configuration file
|
||||
environment = {
|
||||
etc."postgrest/postgrest.conf".text = ''
|
||||
db-uri = "postgres://postgres:postgres@localhost:5432/postgres"
|
||||
db-schema = "public"
|
||||
db-anon-role = "web_anon"
|
||||
server-host = "0.0.0.0"
|
||||
server-port = 3000
|
||||
jwt-secret = "no7WwM0xJa/Yzn5o4IZHG4oBNSShl4JRPZOcmhvnqFw="
|
||||
'';
|
||||
|
||||
systemPackages = with pkgs; [ postgrest ];
|
||||
};
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
5432
|
||||
3000
|
||||
];
|
||||
|
||||
# Create mount point for external USB storage (optional, for better performance)
|
||||
# Uncomment if using the USB 3 storage we configured earlier
|
||||
|
||||
Reference in New Issue
Block a user