Skip to content

Make all version metadata fields configurable#358296

Closed
Princemachiavelli wants to merge 1 commit intoNixOS:masterfrom
Princemachiavelli:jhoffer/make_add_os_release_options
Closed

Make all version metadata fields configurable#358296
Princemachiavelli wants to merge 1 commit intoNixOS:masterfrom
Princemachiavelli:jhoffer/make_add_os_release_options

Conversation

@Princemachiavelli
Copy link
Contributor

Downstream users of NixOS may adapt it for their own products or distro variants. Customizing the version information is ideal so users of these downstream derivatives can see the correct branding, version, and lifecycle support dates of these derivative projects. NixOS is an ideal platform for spin off distros like RedNixOS and NixNG and they can provide their own logo and EOL dates.

Add options for SUPPORT_END and LOGO os-release fields. Make release and codeName internal options instead of readOnly.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 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
  • Fits CONTRIBUTING.md.

Downstream users of NixOS may adapt it for their own products or
distro variants. Customizing the version information is ideal so
users of these downstream derivatives can see the correct branding,
version, and lifecycle support dates of these derivative projects.

Add options for SUPPORT_END and LOGO. Make release and codeName
internal options instead of readOnly.
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 23, 2024
@SigmaSquadron
Copy link
Contributor

This introduces the obvious problem of "well, what if I want to override something else, like ANSI_COLOR?"

Instead of making more and more options for each field in /etc/os-release, we can just override them. I have a PR open that does exactly that.


release = mkOption {
readOnly = true;
internal = true;
Copy link
Contributor

@SigmaSquadron SigmaSquadron Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very much against setting those options as not R/O. Downstreams know where to look and can override them, and there's no reason to have users editing internal distro branding options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstreams know where to look and can override them,

Am I misunderstanding something? internal omits the option from the manual while readOnly options are also cannot be overriden. Or is your point that such downstream use-cases must/ought fork nixpkgs and manually update the field? In any case, I agree is #351736 is a much better solution.

@Princemachiavelli
Copy link
Contributor Author

Closing in favor of #351736

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

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants