modules: services: add postgresql
Enable the service itself in other modules when needed, but pin the package in a single place.
This commit is contained in:
parent
820b52314f
commit
9f00d8a38e
4 changed files with 20 additions and 1 deletions
18
modules/services/postgresql.nix
Normal file
18
modules/services/postgresql.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.services.postgresql;
|
||||
in
|
||||
{
|
||||
options.my.services.postgresql = with lib; {
|
||||
enable = my.mkDisableOption "postgres configuration";
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
# Let other services enable postgres when they need it
|
||||
(lib.mkIf cfg.enable {
|
||||
services.postgresql = {
|
||||
package = pkgs.postgresql_12;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue