module: increase priority for posgresql package default
This gives the default value from this module a slightly higher
priority than the upstream module's default, while still allowing users
to simply set `services.postgresql.package` using the default priority.
The change in 8bc790171f introduced
`mkDefault` for the postgresql package.
Unfortunately the upstream package option default is also specified
using `mkDefault` instead of the more appropriate `mkOptionDefault`.
This meant that users with a `system.stateVersion` other than `22.05`,
`22.11` or `23.05` got an evaluation error because there are two
conflicting definitions for the package option.
This commit is contained in:
parent
e9a0d0e62f
commit
47e376250e
1 changed files with 8 additions and 2 deletions
10
module.nix
10
module.nix
|
|
@ -19,7 +19,8 @@ let
|
||||||
inherit (lib.modules)
|
inherit (lib.modules)
|
||||||
mkDefault
|
mkDefault
|
||||||
mkIf
|
mkIf
|
||||||
mkMerge;
|
mkMerge
|
||||||
|
mkOverride;
|
||||||
|
|
||||||
inherit (lib.options)
|
inherit (lib.options)
|
||||||
mdDoc
|
mdDoc
|
||||||
|
|
@ -354,7 +355,12 @@ in
|
||||||
#
|
#
|
||||||
# After postgresql_14 has been removed from nixpkgs, this workaround can be dropped.
|
# After postgresql_14 has been removed from nixpkgs, this workaround can be dropped.
|
||||||
(mkIf (versionOlder config.system.stateVersion "24.05") {
|
(mkIf (versionOlder config.system.stateVersion "24.05") {
|
||||||
services.postgresql.package = lib.mkDefault pkgs.postgresql_14;
|
# The upstream postgresl module is using mkDefault
|
||||||
|
# to specify the default value for the package option.
|
||||||
|
# Unfortunately this forces us to specify this default with
|
||||||
|
# a higher priority, i.e. lower number, than mkDefault which
|
||||||
|
# has priority 1000
|
||||||
|
services.postgresql.package = mkOverride 999 pkgs.postgresql_14;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue