Skip to content

postgres: fix double cfg on pg_stat_statements install #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

ahuston-0
Copy link
Contributor

Things done

  • Made sure, no settings are changed by default
  • Tested changes on a real world deployment

Note: I'm not running with cfg.enableAllPreloadedLibraries or cfg.configurePgStatStatementsenabled, so testing this mostly just included checking the settings existed and that my dotfiles built.

Addresses the following build failure:

while evaluating the option `system.build.toplevel':
       … while evaluating definitions from `/nix/store/6win34qzpvg1vahlc4iq0nhy1hbh90jg-source/nixos/modules/system/activation/top-level.nix':
while evaluating the option `warnings':
       … while evaluating definitions from `/nix/store/6win34qzpvg1vahlc4iq0nhy1hbh90jg-source/nixos/modules/system/boot/systemd.nix':
while evaluating the option `systemd.services.postgresql.serviceConfig':
       … while evaluating definitions from `/nix/store/6win34qzpvg1vahlc4iq0nhy1hbh90jg-source/nixos/modules/system/boot/systemd.nix':
while evaluating the option `systemd.services.postgresql.postStart':
       … while evaluating definitions from `/nix/store/cx38kwf2qq0ybr0pkinhij8z6x997phv-source/modules/postgres.nix':
       (stack trace truncated; use '--show-trace' to show the full, detailed trace)
       error: attribute 'cfg' missing
       at /nix/store/cx38kwf2qq0ybr0pkinhij8z6x997phv-source/modules/postgres.nix:263:59:
          262|             # based on https://git.catgirl.cloud/999eagle/dotfiles-nix/-/blob/main/modules/system/server/postgres/default.nix#L294-302
          263|             (lib.mkIf (cfg.enableAllPreloadedLibraries || cfg.cfg.configurePgStatStatements) (lib.concatStrings (map (db:
             |                                                           ^
          264|               (lib.concatMapStringsSep "\n" (ext: /* bash */ ''

@SuperSandro2000 SuperSandro2000 merged commit 515bef8 into NuschtOS:main Mar 4, 2025
6 checks passed
@SuperSandro2000
Copy link
Member

What I am wondering is why CI didn't catch that 🤔 do you have any idea?

I am definitely looking into adding a check for postgres to hopefully eval deeper into the module.

@ahuston-0
Copy link
Contributor Author

What I am wondering is why CI didn't catch that 🤔 do you have any idea?

I am definitely looking into adding a check for postgres to hopefully eval deeper into the module.

That I haven't quite figured out yet. I'm wondering if maybe its because the nixosModules.* resolve into just imports and its not actually checking some (all?) of the options at check time? I did do a verbose nix flake check (log here, recommend searching for postgres as its 60k lines) and noticed it doesn't seem to be evaluating anything else when it gets to the nixosModules level.

@SuperSandro2000
Copy link
Member

That could be it. So we probably need a test for each module to force it to evaluate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants