feat(flake): simplify flake template#153
Open
hugosenari wants to merge 7 commits intonumtide:mainfrom
Open
Conversation
zimbatm
reviewed
Dec 6, 2021
Member
zimbatm
left a comment
There was a problem hiding this comment.
thanks, I like the idea. I left a few comments, let me know what you think
zimbatm
reviewed
Dec 10, 2021
Member
zimbatm
left a comment
There was a problem hiding this comment.
A few more ideas. Almost there.
flake.nix
Outdated
Comment on lines
35
to
38
| flakeTOML = inputs: path: eachSystem (system: | ||
| let pkgs = nixpkgs.legacyPackages.${system}.extend self.overlay; | ||
| in { | ||
| devShell = pkgs.devshell.fromTOML path; |
Member
There was a problem hiding this comment.
Suggested change
| flakeTOML = inputs: path: eachSystem (system: | |
| let pkgs = nixpkgs.legacyPackages.${system}.extend self.overlay; | |
| in { | |
| devShell = pkgs.devshell.fromTOML path; | |
| flakeTOML = nixpkgs: path: eachSystem (system: | |
| let devshell = import ./. { pkgs = nixpkgs.legacyPackages.${system}; } | |
| in { | |
| devShell = devshell.fromTOML path; |
Like this, no new instance of nixpkgs is being created. Each instance adds quite a big overhead to nix evaluation. Composition over inheritance :)
Author
There was a problem hiding this comment.
I liked the idea but it didn't work :(
When run `nix develop it says...
error: package "devshell.cli" not found
Changed PR to draft until we solve this
Should I revert?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Make flake template less verbose
Why: The main focus of project is for non nix users, making template less verbose could reduce friction/fear
How: Add a lib method to flake (like flake-utils) but only for devShell
TODO: Update documentation