bun icon indicating copy to clipboard operation
bun copied to clipboard

Add experimental nix support

Open ajkachnic opened this issue 3 years ago • 2 comments
trafficstars

As discussed in the discord, this PR adds experimental Nix support via a default.nix file and a small note in the README. While this is great and all, it still leaves many unanswered questions:

  • Should we be building from source instead? (Currently unfeasible for multiple reasons, but good long term)
  • How should we handle updating versions?
    • Should we just use the latest version at all times?
    • ~~Should use/update check-sums?~~ As mentioned in the discord by @Jarred-Sumner

      There have been a couple cases where I had to re-upload the version after some build issue so it might make sense to forgo the checksum for now

    • Should we dynamically update the default.zig file upon each new release with the Makefile?
  • Should we provide more detailed instructions on how to install with Nix?
  • When is the right time to submit to nixpkgs?
  • How should we handle configuring Bun's cache directory?

and the list goes on.

There are definitely a few things that should be fixed here, this is a decent starting point to build upon.

ajkachnic avatar Dec 12 '21 02:12 ajkachnic

Related: https://github.com/NixOS/nixpkgs/pull/180299

lucasew avatar Jul 09 '22 18:07 lucasew

I think the main benefit of nix in this repo would be pulling in any missing dependencies in a nix dev shell

--

If we also want a package, copying the PR would be good. A source build is an option for the future.

As a note nixpkgs could never fetch nix files from this repo to add the package (that would be IFD (Import From Derivation))

For a reference of another project that offers a package/overlay neovim has some nix stuff in the contrib folder

06kellyjac avatar Jul 09 '22 20:07 06kellyjac

I have created a flake for getting the Bun binary here: bun-flake. Feel free to steal it :smile:

svelterust avatar Nov 19 '22 15:11 svelterust

I have created a flake for getting the Bun binary here: bun-flake. Feel free to steal it smile

Ty, just stole your code and added a bump script in our overlay

Every day at 6am it will verify automagically for new versions and bump

https://github.com/nixosbrasil/nixpkgs-brasil/tree/master/pacotes/utilitarios/bun

lucasew avatar Nov 19 '22 16:11 lucasew

Hey! Just wanting to bump this and to see if there's been any headway in being able to openly support nix builds using flakes? I would attempt it myself, but I'm not experienced enough with nixos as yet

I can see that the package is available on search.nixos.org. But only from version 0.6.2 and not as a flake

koalazub avatar Jul 10 '23 05:07 koalazub

Hey! Just wanting to bump this and to see if there's been any headway in being able to openly support nix builds using flakes? I would attempt it myself, but I'm not experienced enough with nixos as yet

I can see that the package is available on search.nixos.org. But only from version 0.6.2 and not as a flake

We have bun packaged in binary form in our community overlay

It's updated every night

https://github.com/nixosbrasil/nixpkgs-brasil

lucasew avatar Jul 16 '23 18:07 lucasew

Hey! Just wanting to bump this and to see if there's been any headway in being able to openly support nix builds using flakes? I would attempt it myself, but I'm not experienced enough with nixos as yet

I can see that the package is available on search.nixos.org. But only from version 0.6.2 and not as a flake

We have bun packaged in binary form in our community overlay

It's updated every night

https://github.com/nixosbrasil/nixpkgs-brasil

I was kind of confused about the whole discussion as it's not a release that stems from the oven-sh organisation. So I wasn't sure if that was an official package. On top of that, I'm very new to nix and so I was trying to figure out how to install the latest version of it.

I forgot to document on here, but I was able to install the latest version of bun using unstable-nix.pkg and not just nixpkg.

An example of my configuration.nix in case anyone else is still getting their bearings

koalazub avatar Jul 20 '23 01:07 koalazub