Skip to content

pkgs-lib.formats: add mkStructuredType#372501

Merged
h7x4 merged 1 commit intoNixOS:stagingfrom
Stunkymonkey:formats-mkStructuredType
Oct 5, 2025
Merged

pkgs-lib.formats: add mkStructuredType#372501
h7x4 merged 1 commit intoNixOS:stagingfrom
Stunkymonkey:formats-mkStructuredType

Conversation

@Stunkymonkey
Copy link
Copy Markdown
Contributor

@Stunkymonkey Stunkymonkey commented Jan 9, 2025

currently the types are pretty redundant. i hope to improve via MR.

tested via nix-build . -A tests.pkgs-lib.formats

not sure if this should be documented, because i see this more as an internal function.

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.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jan 9, 2025
@Stunkymonkey Stunkymonkey mentioned this pull request Jan 13, 2025
13 tasks
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from 72ca315 to 7f6a0a2 Compare January 13, 2025 21:27
@github-actions github-actions bot removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation labels Jan 13, 2025
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from 7f6a0a2 to 4b16cc4 Compare January 13, 2025 21:29
@Stunkymonkey Stunkymonkey marked this pull request as ready for review January 13, 2025 21:30
@Stunkymonkey Stunkymonkey requested a review from h7x4 February 17, 2025 21:46
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@Stunkymonkey Stunkymonkey removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 2, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 9, 2025
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from 4b16cc4 to 92c9b03 Compare July 28, 2025 20:02
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501-1000 This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jul 28, 2025
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch 2 times, most recently from f634047 to a99752d Compare July 28, 2025 20:19
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from a99752d to 500b84c Compare October 3, 2025 06:54
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 3, 2025
@h7x4 h7x4 force-pushed the formats-mkStructuredType branch from 500b84c to b82aadf Compare October 4, 2025 01:21
@h7x4
Copy link
Copy Markdown
Member

h7x4 commented Oct 4, 2025

Resolved merge conflict

@h7x4
Copy link
Copy Markdown
Member

h7x4 commented Oct 4, 2025

This should probably target staging

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Oct 4, 2025
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from b82aadf to d5811db Compare October 5, 2025 09:41
@Stunkymonkey Stunkymonkey changed the base branch from master to staging October 5, 2025 09:46
@nixpkgs-ci nixpkgs-ci bot closed this Oct 5, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Oct 5, 2025
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from d5811db to a8d3638 Compare October 5, 2025 09:46
@Stunkymonkey Stunkymonkey force-pushed the formats-mkStructuredType branch from a8d3638 to c5cdad7 Compare October 5, 2025 09:47
@Stunkymonkey Stunkymonkey requested a review from h7x4 October 5, 2025 09:48
@h7x4 h7x4 merged commit e4a0c03 into NixOS:staging Oct 5, 2025
26 checks passed
@mweinelt
Copy link
Copy Markdown
Member

mweinelt commented Oct 5, 2025

tested via nix-build . -A tests.pkgs-lib.formats

Are we missing tests for nullability then?

@h7x4
Copy link
Copy Markdown
Member

h7x4 commented Oct 5, 2025

Yes, nothing is using nullability at the moment.

Planning to rework this later, is it fine if we just open a fixup PR to staging with the parameter comment added?

@mweinelt
Copy link
Copy Markdown
Member

mweinelt commented Oct 5, 2025

Yes, nothing is using nullability at the moment.

Why do you think that? AIUI this just needs a freeform type with pkgs.formats.foo and a value set to null. Doesn't sound exotic to me at all.

@h7x4
Copy link
Copy Markdown
Member

h7x4 commented Oct 5, 2025

Sorry, I think I was a bit unclear. None of the formats that use this helper function are explicitly setting nullability = false to disallow null values in the format, meaning that the option is not used yet and by extension not tested either. This is not a new format, just a helper for a common pattern among the existing ones.

@mweinelt
Copy link
Copy Markdown
Member

mweinelt commented Oct 5, 2025

Nvm, I just saw that nullability just moved from baseType into valueType.

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

Labels

10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants