Skip to content

Commit

Permalink
nixos/postgresql: fix merging of shared_preload_libraries option
Browse files Browse the repository at this point in the history
Closes #386804

The issue with coercing to `types.str` is that it's not mergeable, so
any declarations will result in an eval error like this:

    error: The option `interactive.nodes.tmp.services.postgresql.settings.shared_preload_libraries' has conflicting definition values:
    - In `/home/ma27/Projects/nixpkgs-hack/tmp.nix@node-tmp': "foo"
    - In `/home/ma27/Projects/nixpkgs-hack/tmp.nix@node-tmp': "bar2"
    Use `lib.mkForce value` or `lib.mkDefault value` to change the priority on any of these definitions.

Using a mergeable type (`types.comma`, i.e. a string, where all declarations
get joined with a comma as delimiter) fixes the problem.
  • Loading branch information
Ma27 committed Mar 10, 2025
1 parent 3847faf commit 8bf1e13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/databases/postgresql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ in
]);
options = {
shared_preload_libraries = mkOption {
type = nullOr (coercedTo (listOf str) (concatStringsSep ", ") str);
type = nullOr (coercedTo (listOf str) (concatStringsSep ",") commas);
default = null;
example = literalExpression ''[ "auto_explain" "anon" ]'';
description = ''
Expand Down

0 comments on commit 8bf1e13

Please sign in to comment.