waffentrager: postresql version

This commit is contained in:
Mateusz Słodkowicz 2024-03-23 12:39:23 +01:00
parent b700364ac1
commit d5ef421ebb
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
1 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{ materusArg, config, lib, pkgs, ... }: { materusArg, config, lib, pkgs, ... }:
{ {
options.waffentragerService.postgresql.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable postgresql"; options.waffentragerService.postgresql.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable postgresql";
options.waffentragerService.postgresql.version = lib.mkOption { default = "16"; };
config = config =
let let
@ -11,8 +11,8 @@
waffentragerService.elements.enable = true; waffentragerService.elements.enable = true;
services.postgresql.enable = true; services.postgresql.enable = true;
services.postgresql.package = pkgs.postgresql_16; services.postgresql.package = pkgs."postgresql_${cfg.version}";
services.postgresql.dataDir = "${config.waffentragerService.elements.postgresqlDir}/16"; services.postgresql.dataDir = "${config.waffentragerService.elements.postgresqlDir}/${cfg.version}";
systemd.services.postgresql = { systemd.services.postgresql = {
partOf = [ "elements-mount.service" ]; partOf = [ "elements-mount.service" ];
requires = [ "elements-mount.service" ]; requires = [ "elements-mount.service" ];