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

add flakeDir option to automatically set the FLAKE variable #47

Merged
merged 3 commits into from
Dec 14, 2023

Conversation

NotAShelf
Copy link
Contributor

Adds a flakeDir option that sets the FLAKE variable for the user.

@viperML
Copy link
Owner

viperML commented Dec 12, 2023

  1. Why not call it flake instead of flakeDir? If you are concerned about the user setting a flake.nix, it can be asserted.

  2. Type should be types.path

  3. What if the user doesn't set it? The type should be nullOr path then.

@NotAShelf
Copy link
Contributor Author

I was thinking an assertion instead of a nullOr - but that's not very backwards compatible. I'll make it nullOr.

@NotAShelf
Copy link
Contributor Author

Okay, it now asserts if nh.flake points at a file that has the .nix prefix.

@viperML
Copy link
Owner

viperML commented Dec 12, 2023

Checks fail

@NotAShelf
Copy link
Contributor Author

I really don't know if that mkIf is the correct way to conditionally assert.

@NotAShelf NotAShelf marked this pull request as ready for review December 12, 2023 09:10
@viperML
Copy link
Owner

viperML commented Dec 12, 2023

Why not?

assertion = (config.nh.flake != null) -> !(lib.hasSuffix ".nix" config.nh.flake)

@NotAShelf
Copy link
Contributor Author

Mainly because I didn't know how the -> operator worked. Will change.

@viperML viperML force-pushed the master branch 6 times, most recently from 0ec3bee to fc720bb Compare December 13, 2023 23:23
@viperML
Copy link
Owner

viperML commented Dec 14, 2023

Is it ready?

@NotAShelf
Copy link
Contributor Author

Will commit tonight.

@NotAShelf
Copy link
Contributor Author

Should be good now.

@viperML viperML merged commit 5254741 into viperML:master Dec 14, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants