-
Notifications
You must be signed in to change notification settings - Fork 93
feat(flake): simplify flake template #153
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
3c3976c
ac375a0
67afbed
7c876f2
a12b7e7
f2b4c41
e5004d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| description = "devshell"; | ||||||||||||||||||
|
|
||||||||||||||||||
| outputs = { self }: | ||||||||||||||||||
| outputs = { self, nixpkgs }: | ||||||||||||||||||
| let | ||||||||||||||||||
| eachSystem = f: | ||||||||||||||||||
| let | ||||||||||||||||||
|
|
@@ -32,13 +32,20 @@ | |||||||||||||||||
| legacyPackages = devshell; | ||||||||||||||||||
| devShell = devshell.fromTOML ./devshell.toml; | ||||||||||||||||||
| }; | ||||||||||||||||||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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. Choose a reason for hiding this commentThe 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...
Changed PR to draft until we solve this Should I revert?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reverted ☹ |
||||||||||||||||||
| } | ||||||||||||||||||
| ); | ||||||||||||||||||
| in | ||||||||||||||||||
| { | ||||||||||||||||||
| defaultTemplate.path = ./template; | ||||||||||||||||||
| defaultTemplate.description = "nix flake new 'github:numtide/devshell'"; | ||||||||||||||||||
| # Import this overlay into your instance of nixpkgs | ||||||||||||||||||
| overlay = import ./overlay.nix; | ||||||||||||||||||
| lib = { | ||||||||||||||||||
| inherit flakeTOML; | ||||||||||||||||||
| importTOML = import ./nix/importTOML.nix; | ||||||||||||||||||
| }; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.