LnL7 / nix-darwin

nix modules for darwin
MIT License
3.19k stars 457 forks source link

Fix darwin-rebuild changelog not displaying #1070

Closed antoineco closed 2 months ago

antoineco commented 2 months ago

The script returns early when $systemConfig is empty, which currently prevents the changelog from being displayed.

Fixes #329


Before, $systemConfig=

$ darwin-rebuild changelog
(nothing)

After, $systemConfig=/nix/store/22dc9r5hhm311x5bffwjjr1abr3r2jrz-darwin-system-24.05.20240830.6e99f2a+darwin5.f4f18f3:

$ darwin-rebuild changelog
CHANGELOG

2024-09-10
- The default Nix build user group ID is now set to 350 when
  `system.stateVersion` ≥ 5, to reflect the default for new Nix
  installations. This only affects installations that enable
  `nix.configureBuildUsers`, and any divergence will be detected on
  system activation. To use `nix.configureBuildUsers` with a higher
  `system.stateVersion` on installations using the old group ID, set:

      ids.gids.nixbld = 30000;

  We do not recommend trying to change the group ID with macOS user
  management tools without a complete uninstallation and reinstallation
  of Nix.

...
emilazy commented 2 months ago

Thanks, I was wondering why this was broken. The head -n 32 is weird, we should probably just run ${PAGER:-less} on the file. Do you mind doing that or do you want me to handle it in another PR?

(FWIW the convention here / in Nixpkgs is to just use topic: rather than conventional commits, although we’re not very strict about those standards. In Nixpkgs it’s more important since the CI tools read commit messages.)

antoineco commented 2 months ago

@emilazy done and done, thanks for the input.