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

Custom flake checkers (as plugins?) #3487

Open
vikanezrimaya opened this issue Apr 11, 2020 · 7 comments · May be fixed by #8892
Open

Custom flake checkers (as plugins?) #3487

vikanezrimaya opened this issue Apr 11, 2020 · 7 comments · May be fixed by #8892
Labels

Comments

@vikanezrimaya
Copy link
Member

Right now nix flake check checks sanity of a lot of common flake attributes, but it fails to consider that there are tools that might extend flakes' usability beyond what Nix and NixOS offers - e.g. home-manager. Currently in my personal flake (https://gitlab.com/vikanezrimaya/nix-flake) I use homeManagerModules and homeManagerConfigurations as additional flake outputs for home-manager and an attribute called activationPackage, that for every machine deploys a NixOS configuration and my personal home-manager config. Nix warns me of existence of these attributes as if they're typos. I'd like to somehow extend Nix (maybe with a plugin somehow embedded in a flake?) that will type-check all of the custom attributes I designed.

@stale
Copy link

stale bot commented Feb 16, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 16, 2021
@vikanezrimaya
Copy link
Member Author

Might not be urgent, but still important for me.

@stale
Copy link

stale bot commented Sep 14, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Sep 14, 2021
@gytis-ivaskevicius
Copy link
Contributor

Does this solve your problem? https://github.com/numtide/flake-utils/tree/master/examples/checks-utils

So what you'd do is compare the attribute type. To be fair more specific utilities for this use case should be defined

@stale stale bot removed the stale label Sep 23, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Apr 16, 2022
@Infinidoge
Copy link

Infinidoge commented Nov 1, 2022

checks-utils isn't a (proper) solution.
The problem is that nix flake check gives messages like:

warning: unknown flake output 'deploy'
warning: unknown flake output 'lib'
warning: unknown flake output 'homeConfigurations'

Which, given that other tools may define their own flake outputs, is unhelpful.
Adding in a form of plugins which lets you extend the flake definition would be ideal.

Using checks (which checks-utils definitely helps with) can give you most of what is wanted, though it somewhat muddles the output by having those sanity checks being a part of the general checks attribute, instead of being in their own section.

(Ran into the issue as I've been trying to migrate my own projects to better make use of nix flake check)

@stale stale bot removed the stale label Nov 1, 2022
@edolstra edolstra linked a pull request Aug 31, 2023 that will close this issue
8 tasks
@nakoo
Copy link

nakoo commented Aug 10, 2024

I feel the same. I believe there is better way instead of hard-coded like this
https://github.com/nixos/nix/blob/master/src/nix/flake.cc#L773-L785

I'm patiently waiting #8892 would be merged but sadly it takes a lot of time than I expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants