Skip to content
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

nixos/systemd: Custom error when mixing list/non-list defs #158602

Merged
merged 1 commit into from
Jun 19, 2022

Conversation

roberth
Copy link
Member

@roberth roberth commented Feb 8, 2022

Motivation for this change

Provide context for an otherwise incomprehensible error and stack trace.

Before

error: value is a set while a list was expected

After

error: The definitions for systemd unit options should be either all lists, representing repeatable options, or all non-lists, but for the option systemd.services.postgresql.serviceConfig.ExecStartPre, the definitions are a mix of list and non-list
       - In `/nix/store/8nby8xsm4zf05nb1samj8gr8ya6xjq10-bi4hb1h745xlilain27syz9017a1a2l3-source/nixos/modules/system/boot/systemd.nix':
           [
             "/nix/store/74jkxldlh08njc5c8r24pw8rp5jmrvlw-unit-script-postgresql-pre-start/bin/postgresql-pre-start"
           ]
       - In `/home/user/proj/modules/postgresql.nix': <derivation /nix/store/bbd9zgis92iyaxn81m7l6zadb40rj0gd-postgres-standby-setup.drv>

This is a partial solution to #158606.
Ideally, I think we should have all systemd options modeled in NixOS, as this is not really a solution to the underlying problem, but it's not feasible until #158594 and perhaps even #158598 for performance (not sure).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

cc @NixOS/systemd-committers

@roberth
Copy link
Member Author

roberth commented Jun 18, 2022

@NixOS/systemd please review

@Mic92 Mic92 merged commit f5ca531 into NixOS:master Jun 19, 2022
@Mic92
Copy link
Member

Mic92 commented Jun 19, 2022

Tested locally and works as intended.

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

Successfully merging this pull request may close these issues.

2 participants