mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-01 20:46:12 +01:00
aff0158ef7
Signed-off-by: magic_rb <magic_rb@redalder.org>
47 lines
846 B
Nix
47 lines
846 B
Nix
{
|
|
makeSystem,
|
|
nixpkgs,
|
|
}:
|
|
makeSystem {
|
|
system = "x86_64-linux";
|
|
name = "nixng-hass-postgresql";
|
|
inherit nixpkgs;
|
|
config = {
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit
|
|
(lib)
|
|
singleton
|
|
;
|
|
in {
|
|
config = {
|
|
dumb-init = {
|
|
enable = true;
|
|
type.services = {};
|
|
};
|
|
services.postgresql = {
|
|
enable = true;
|
|
package = pkgs.postgresql_12;
|
|
|
|
initialScript = "/secrets/init.sql";
|
|
enableTCPIP = true;
|
|
|
|
authentication = "host all all all md5";
|
|
|
|
ensureDatabases = ["hass"];
|
|
ensureExtensions = {
|
|
"pg_trgm" = ["hass"];
|
|
};
|
|
ensureUsers = singleton {
|
|
name = "hass";
|
|
ensurePermissions = {
|
|
"DATABASE \"hass\"" = "ALL PRIVILEGES";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|