diff --git a/module.nix b/module.nix index 57c129b7f7..6837e64170 100644 --- a/module.nix +++ b/module.nix @@ -4,7 +4,7 @@ let teslamate = self.packages.${pkgs.system}.default; cfg = config.services.teslamate; - inherit (lib) mkEnableOption mkOption types mkIf mkMerge getExe literalExpression; + inherit (lib) mkPackageOption mkEnableOption mkOption types mkIf mkMerge getExe literalExpression; in { options.services.teslamate = { enable = mkEnableOption "Teslamate"; @@ -68,6 +68,12 @@ in { ''; }; + package = mkPackageOption pkgs "postgresql_16" { + extraDescription = '' + The postgresql package to use. + ''; + }; + user = mkOption { type = types.str; default = "teslamate"; @@ -187,8 +193,7 @@ in { (mkIf cfg.postgres.enable_server { services.postgresql = { enable = true; - package = pkgs.postgresql_16; - inherit (cfg.postgres) port; + inherit (cfg.postgres) port package; initialScript = pkgs.writeText "teslamate-psql-init" '' \set password `echo $DATABASE_PASS`