also refactor nixos modules
This commit is contained in:
parent
2471562583
commit
b37c5c0cbd
44 changed files with 10 additions and 2 deletions
30
modules/nixos/services/persistance/postgresql.nix
Normal file
30
modules/nixos/services/persistance/postgresql.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
|
||||
cfg = config.sneeuwvlok.services.persistance.postgresql;
|
||||
in {
|
||||
options.sneeuwvlok.services.persistance.postgresql = {
|
||||
enable = mkEnableOption "Postgresql";
|
||||
};
|
||||
|
||||
# Access db with `psql -U postgres`
|
||||
config = mkIf cfg.enable {
|
||||
services = {
|
||||
postgresql = {
|
||||
enable = true;
|
||||
authentication = ''
|
||||
# Generated file, do not edit!
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
local all all trust
|
||||
host all all 127.0.0.1/32 trust
|
||||
host all all ::1/128 trust
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue