Bruno BELANYI
99c33cd7ad
Enable the service itself in other modules when needed, but pin the package in a single place.
19 lines
389 B
Nix
19 lines
389 B
Nix
{ 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;
|
|
};
|
|
})
|
|
];
|
|
}
|