-
Notifications
You must be signed in to change notification settings - Fork 0
Remove node2nix from Typescript's Nix utilities #162
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
Conversation
856bd4c
to
d116f31
Compare
d116f31
to
fc3c3fd
Compare
fc3c3fd
to
0fc8d17
Compare
# ``` | ||
# So instead, we explicitly write out all the attribute names and what | ||
# they are assigned to. | ||
inherit (typescriptFlake) packages checks devShells; |
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.
Woo hoo, no more IFD so this works now :^)
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.
hell yes!
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.
This is great!!!
A question though. Is this really flake-typescript? or is it flake-npm? or smtn like that? At which point is typescript invoked here I can't figure it out :D
@@ -0,0 +1,53 @@ | |||
# Given a `package-lock.json`, grabs all packages as tarballs. |
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.
Can you state which npm versions have what you expect?
buildPhase = '' | ||
cp -r "$src" . | ||
cp -r "$src/." . |
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.
Haha yes, cp
is difficult
# ``` | ||
# So instead, we explicitly write out all the attribute names and what | ||
# they are assigned to. | ||
inherit (typescriptFlake) packages checks devShells; |
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.
hell yes!
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.
Also heads up, you have dependencies
, but you also need data
(dependencies). Curious how that will work
I suppose this really is just Unfortunately, I ended up not going with this, so I'll close this PR. |
Surprisingly, one can scan the
package-lock.json
for URLS of tarballs for dependencies, then fetch those tarballs in a nix derivation, and manually add them intonpm
's cache. Then,npm install
will surprisingly manage to find everything in the cache without hitting the network.Future work
For now, this only supports grabbing things from the npm registry, and in the future we would like to support the complete set of allowed package-specs by
npm
.Honestly, a better way forward would probably to cook up a proxy registry to the npm registry. override
npm
s.t. it always uses the proxy registry, and dump all the nix packages there. A brief glance suggests that https://verdaccio.org/ might be useful for this :^).