This commit is contained in:
commit
30ce0dafc2
195 changed files with 8902 additions and 0 deletions
6
services/postgresql/default.nix
Normal file
6
services/postgresql/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./options.nix
|
||||
./service.nix
|
||||
];
|
||||
}
|
||||
14
services/postgresql/options.nix
Normal file
14
services/postgresql/options.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{ lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.machine.postgresql = {
|
||||
enable = mkEnableOption "Postgresql";
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 5432;
|
||||
description = ''
|
||||
The port on which PostgreSQL listens.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
29
services/postgresql/service.nix
Normal file
29
services/postgresql/service.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (config.machine.postgresql)
|
||||
port
|
||||
enable
|
||||
;
|
||||
in
|
||||
with lib; mkIf enable {
|
||||
services.postgresql = {
|
||||
inherit enable;
|
||||
settings = {
|
||||
inherit port;
|
||||
};
|
||||
ensureDatabases = [ ];
|
||||
enableTCPIP = true;
|
||||
authentication = mkOverride 10 ''
|
||||
#type database DBuser origin-address auth-method
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
host all all 0.0.0.0/0 md5
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue