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

flake-check: add support for disabling certain outputs #11818

Open
Pablito2020 opened this issue Nov 6, 2024 · 0 comments
Open

flake-check: add support for disabling certain outputs #11818

Pablito2020 opened this issue Nov 6, 2024 · 0 comments
Labels
feature Feature request or proposal

Comments

@Pablito2020
Copy link

Is your feature request related to a problem? Please describe.
I encountered a situation where it would be beneficial to have an option in nix flake check to ignore certain outputs that are expected to fail when evaluated. Initially, I considered whether this should be an issue or a pull request, but I decided to proceed with the PR since this change introduces a potential solution.

The main use case for this flag is with NixOS configurations that are impure by design, such as configurations that include decryption keys or other sensitive information. For example, in my setup, I have the following outputs:

├───nixosConfigurations
│   ├───laptop: NixOS configuration
│   ├───laptop-install: NixOS configuration
│   ├───pc: NixOS configuration
│   ├───pc-install: NixOS configuration
....

The -install configurations are used for deploying NixOS on new hosts with nixos-anywhere. These configurations contain sensitive keys for decrypting secrets needed only during installation, and they cause CI checks to fail since the secrets are not available on the CI machine. Currently, my CI setup runs nix fmt check on all outputs, but because of these impure -install configurations, it fails.

I thought that this was only usefull on a nixosConfiguration system (because why would you like to have an impure devShell, or package build?).

Describe the solution you'd like
A flag that disables checks for given outputs (maybe only nixosConfiguration systems, as the others makes sense to keep them pure).

I did a POC here: Pablito2020@6fb6f18

Describe alternatives you've considered
Checking only the hosts that I know that they don't fail via CI, but it is easier to have a "blocklist" and ignore this outputs than a "whitelist" on a CI (because you can forgive to check new outputs, but you can't ignore an error in CI)

Additional context
None

Priorities

Add 👍 to issues you find important.

@Pablito2020 Pablito2020 added the feature Feature request or proposal label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal
Projects
None yet
Development

No branches or pull requests

1 participant