-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat(flake): simplify flake template #153
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I like the idea. I left a few comments, let me know what you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more ideas. Almost there.
flake.nix
Outdated
flakeTOML = inputs: path: eachSystem (system: | ||
let pkgs = nixpkgs.legacyPackages.${system}.extend self.overlay; | ||
in { | ||
devShell = pkgs.devshell.fromTOML path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted ☹
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