-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Improve flake.nix to save build time, make nix run
work again, and check builds on CI
#312
Conversation
The master branch is where PRs are merged into. Binary cache is more likely available on stable and unstable branches, so switch to unstable to use latest packages.
In NixOS/nixpkgs, the latest version of BEAM packages may not have all packages built on Hydra. In fact, rebar3 is not available from binary cache, which requires the package user to rebuild the package. Downgrading to the previous version of Erlang VM solves this issue.
The path points to a location which apparently no longer exists.
Setting meta.mainProgram is recommended now so `nix run` consistently works.
The user may want to use the same versions as his/her project under development, so it makes sense to allow overriding of beamPackages and elixir.
nix run
work, and check builds on CInix run
work again, and check builds on CI
Wow, this is awesome! The one thing is that OTP26 is a requirement, would making my own binary cache for Next LS help with the build time? I'm still a nix newb, so I appreciate the help! |
You can sign up an account on Cachix and use cachix-action to upload assets to its server. Cache settings can be added to |
I seem to have messed the ld-linux part, but I think I have fixed it. Sorry about that. It now works, at least on |
Awesome, i'll pull this down tonight to confirm it works. I was able to make a binary cache with cachix, just need to figure out how to make the flake use it and get that github action figured out. |
@akirak do you happen to know why the flake installs Elixir 1.14 and 1.15? It already did that before this patch, but I am curious if you know of an explanation |
I tried to run this branch locally on my x86 Linux computer and got a hash mismatch
|
Same on my M1 MacBook Air |
It seems that fetchMixDeps brings the default version of Elixir, which is currently 1.14: https://github.com/nixos/nixpkgs/blob/master/pkgs/development/beam-modules/fetch-mix-deps.nix#L12 Fixed at ba5b0ef |
You have to update the hash value of |
Here is an instruction:
I would also suggest adding {
nixConfig = {
extra-substituters = [ "https://emacs-ci.cachix.org" ];
extra-trusted-public-keys = [ "emacs-ci.cachix.org-1:B5FVOrxhXXrOL0S+tQ7USrhjMT5iOPH+QN9q0NItom4=" ];
};
...
} |
so if someone does |
No, the user has to manually approve the extra substituter, unless he/she runs Nix with Thanks! |
Generally speaking, Do either of you have strong feelings about keeping or removing those |
I have no feelings and will defer to more experienced nix users. PRs are welcome! |
@shanesveller I would avoid |
Hello, I am trying to switch from Elixir LS to Next LS. I am a user of NixOS, so I have checked out
flake.nix
already included in this repository.I thought the configuration could be better by applying changes proposed in this PR, that will:
Downgrade to Erlang R25 because the latest release is not completely ready for NixOS users yet.Major BEAM packages are available from the official binary cache if you pick the previous release or older, but not for R26 yet. Also, the master branch of nixpkgs is somewhat meant for development, so switch to unstable channel where things are less likely to be broken.meta.mainProgram
of the package sonix run
works. The app seemed to be broken, so I have removed it.flake.nix
.I am about to incorporate the package into my project, and it seems to be working. Thank you for working on this awesome project!