-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add experimental nix support #76
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
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||
| { stdenv | ||||||
| , autoPatchelfHook | ||||||
| , fetchurl | ||||||
| , openssl | ||||||
| , unzip | ||||||
| , pkgs | ||||||
| , ... }: | ||||||
| let | ||||||
| version = "0.0.52"; | ||||||
| checksum = "88k0RW6/X/CudqExRwnbfzpKcxHJ3BvtvX2dIudqU+A="; | ||||||
| bun_install = "/home/<whatever>/.bun"; # Set this to where you want bun's cache | ||||||
|
Collaborator
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. Would it be possible to fill this in with the current user's home directory instead of manually editing?
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. It could be 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
https://nixos.org/manual/nix/stable/expressions/builtins.html#builtins-getEnv 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. Just wrap with escaped $ so it evaluates when ran rather than in the build |
||||||
| in stdenv.mkDerivation { | ||||||
| pname = "bun"; | ||||||
| version = version; | ||||||
| src = fetchurl { | ||||||
| url = "https://github.com/Jarred-Sumner/bun-releases-for-updater/releases/download/bun-v${version}/bun-linux-x64.zip"; | ||||||
| sha256 = checksum; | ||||||
| }; | ||||||
| sourceRoot = "."; | ||||||
| unpackCmd = "unzip bun-linux-x64.zip"; | ||||||
| dontConfigure = true; | ||||||
| dontBuild = true; | ||||||
| nativeBuildInputs = [ pkgs.makeWrapper autoPatchelfHook ]; | ||||||
| buildInputs = [ unzip openssl stdenv.cc.cc.lib ]; | ||||||
|
|
||||||
| installPhase = "install -D ./bun-linux-x64/bun $out/bin/bun"; | ||||||
| postInstall = '' | ||||||
| wrapProgram "$out/bin/bun" \ | ||||||
| --prefix BUN_INSTALL : ${bun_install} | ||||||
| ''; | ||||||
| } | ||||||
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.
Would it be possible to pass a url to nix? If so, I could get the
default.nixpackage up on bun.shThere 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.
You can build a remote expressions to an extent yeah
https://nixos.org/manual/nix/stable/command-ref/nix-build.html
With nix 3.0 & flakes you can easily do something like
nix build github:Jarred-Summer/bunThere's probably a way to set up a domain name but not played with it