Skip to content

contracts RFC - alternate implementation using generated options#500287

Closed
KiaraGrouwstra wants to merge 12 commits into
NixOS:masterfrom
KiaraGrouwstra:contracts-secret-generated
Closed

contracts RFC - alternate implementation using generated options#500287
KiaraGrouwstra wants to merge 12 commits into
NixOS:masterfrom
KiaraGrouwstra:contracts-secret-generated

Conversation

@KiaraGrouwstra
Copy link
Copy Markdown
Contributor

@KiaraGrouwstra KiaraGrouwstra commented Mar 16, 2026

This is a PR for contracts (NixOS/rfcs#189), using a fileSecrets contract as an example.
This iteration is similar to the earlier:

Feedback welcome!
In particular:

  • I'd be curious as to how unidiomatic the option generation looks - while I know types.optionType had a .merge, I tried to look for a method that might work with an API that's somewhat more plain.
  • A move to lib helped build the docs by preventing types from depending on config, resulting in the current evalOption construct to be able to use the module system there still.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@KiaraGrouwstra KiaraGrouwstra mentioned this pull request Mar 16, 2026
18 tasks
@nixos-discourse
Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/self-host-blocks-building-blocks-for-self-hosting-with-best-practices/26963/42

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 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/` 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library labels Mar 16, 2026
@KiaraGrouwstra KiaraGrouwstra force-pushed the contracts-secret-generated branch from e39e587 to 4f5c076 Compare March 16, 2026 04:16
@KiaraGrouwstra KiaraGrouwstra force-pushed the contracts-secret-generated branch 3 times, most recently from e253418 to 963f8fc Compare March 17, 2026 10:44
@KiaraGrouwstra KiaraGrouwstra force-pushed the contracts-secret-generated branch from 963f8fc to 1e35a8b Compare March 19, 2026 01:43
Signed-off-by: cinereal <[email protected]>
@KiaraGrouwstra
Copy link
Copy Markdown
Contributor Author

KiaraGrouwstra commented Mar 31, 2026

while this PR was somewhat modest, i've since been on a more invasive reimagining of this making for a nicer API and accounting for use with modular services. i feel like, given the API changes, pushing that here would go against the more humble spirit of this PR, so i'll try and prepare a new one instead.

@KiaraGrouwstra
Copy link
Copy Markdown
Contributor Author

as promised: #506343

@KiaraGrouwstra KiaraGrouwstra requested review from baileylu121 and removed request for baileylu121 April 3, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lib The Nixpkgs function library 6.topic: module system About "NixOS" module system internals 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/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants