Skip to content
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

Package with Nix #227

Open
elsirion opened this issue Oct 10, 2023 · 7 comments
Open

Package with Nix #227

elsirion opened this issue Oct 10, 2023 · 7 comments

Comments

@elsirion
Copy link
Contributor

elsirion commented Oct 10, 2023

Ideally we would be able to build the static site as a nix package. I made an attempt but failed so far, some learnings:

  • yarn2nix seems to be the blessed way of doing so
  • yarn install && yarn build works in the nix dev shell (I also created a .#ui shell on my fork without the Fedimint tooling, less compiling)
  • package.json needs a name and version for yarn2nix to do anything.
  • The node_modules directory created by yarn2nix has fewer directories than the one created by yarn install. Why? Do some modules run their own install scripts not captured by yarn.lock?
  • This project uses turbo, which I could find nothing about in relation to yarn2nix, so there might be some weird interaction like yarn not being run in offline mode.

If anyone opens a PR that adds a nix derivation to our existing flake which builds the both static sites (guardian-ui, gateway-ui) I'll happily send you 1M sats.

The error I was running into:
2023-10-09-200025_3840x2160_scrot

@dpc
Copy link
Contributor

dpc commented Oct 11, 2023

I have failed at completing this task before, got my self-estem hurt, cried a little, then ranted about JS being terrible on Twitter, then learned HTMX promising myself I will get my revenge and rewrite the whole thing in Rust with all the interactivity done via HTMX.

Anyway, in the meantime it's probably easier to solve it by finding someone that understands npm/yarn + turbo that is willing to get hands dirty with Nix.

@elsirion
Copy link
Contributor Author

The workaround I intend to use in the short term is fetching a pre-built tar archive, depends on #225.

@MatthewCroughan
Copy link

If you guys could stop using yarn and switch to using the now more common, standard and supported package-lock.json, it would be easy to package the repo with dream2nix, although I agree with @dpc sentiments on HTMX.

@EthnTuttle
Copy link
Collaborator

If you guys could stop using yarn and switch to using the now more common, standard and supported package-lock.json, it would be easy to package the repo with dream2nix, although I agree with @dpc sentiments on HTMX.

Happy to review a PR to rip up and replace our framework.

@justinmoon
Copy link
Contributor

The workaround I intend to use in the short term is fetching a pre-built tar archive, depends on #225.

If we had a tarball, would you still want nix packaging?

@elsirion
Copy link
Contributor Author

Eventually for sure, just wouldn't spend too much time on it for now. The bounty is there if anyone figures out a way to do it in the meantime.

@justinmoon
Copy link
Contributor

Call: 2 benefits

  • deployments fixed with tarballs
  • with nix we will be able to build this project in remote future

Will offers a deal: once we have a version that we want people to run in the distant future, we will do this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants