canva-public / js2nix

Node.js modules installation using Nix
MIT License
63 stars 14 forks source link

feat: introduce flake #15

Open olebedev opened 1 year ago

olebedev commented 1 year ago

Motivation

Introduce Nix flake so it allows using this project from Nix flake based projects as well. It's noteworthy that the default exported package is not a Nix package but a function that allows to build environments.

Test the changes

$ nix develop -c jest
$ nix develop -c js2nix --help

Resolves #4

@typetetris, @blaggacao, any feedback is very welcome.

yangm97 commented 1 year ago

I tried using this branch from a flake but all dependencies end up failing to build. For instance:

$ nix log /nix/store/r89z38dr2n8cmakjmhmcpbnp6wb37bmj-duration-0.2.2.tgz.drv

trying https://registry.yarnpkg.com/duration/-/duration-0.2.2.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: registry.yarnpkg.com
Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: registry.yarnpkg.com
Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: registry.yarnpkg.com
Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
^M  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: registry.yarnpkg.com
error: cannot download duration-0.2.2.tgz from any mirror