4 ms·
Beside being invasive on MacOS, as said by @ridiculous_fish, it took me more than 3 hours (and it didn't yet finish, I just quit all) to use QMK. I just cloned
by rrgok 4y ago
Beside being invasive on MacOS, as said by @ridiculous_fish, it took me more than 3 hours (and it didn't yet finish, I just quit all) to use QMK. I just cloned the Github repository of QMK and did `nix-shell` as they provide shell.nix file.
1. Does every nix-shell require building the whole world from ground-up? Seems impractical to me.
2. What is the right approach?
This is not to bash Nixpkgs, because I installed NixOS and it took me 10min to install a whole OS with Sway, Neovim and some other tools. I guess I'm doing something wrong. But, on MacOS, nixpkgs was not a pleasant experience at all.
- rgoulter 4y ago> 1. Does every nix-shell require building the whole world from ground-up? Seems impractical to me. It's the same as homebrew: If there's a cached binary already, it will download the cached binary. If not, it will fetch the source and build it. The QMK nix shell needs different GCCs for different targets. For the QMK shell.nix specifically, you can disable the targets you don't need (e.g. if you don't use a teensy board).
- rrgok 4y agoThat makes sense. Is there a `nix-shell` option that outputs which packages will be compiled from source and which will get a precompiled binary? Something like `nix-shell --dry-run`? I have to learn more about the nix language, but looking at the shell.nix seems that I have comment/remove lines from 25 to 30 according to my board.
- ParetoOptimal 4y ago> Something like `nix-shell --dry-run`? Exactly that? Lol :)
- rrgok 4y agoReally? It is not written in the official nix-shell manual https://nixos.org/manual/nix/stable/command-ref/nix-shell.html https://nixos.org/manual/nix/stable/command-ref/nix-shell.ht... I still will try when I get to my macbook. Thank you!
- ParetoOptimal 4y agoI misread that as `nix-build --dry-run`, sorry! You can use nix-build on a shell.nix though i'm pretty sure.
- SAI_Peregrinus 4y agoJust tried it, it does work. Not in the `--help` though.
- sph 4y agoThis subthread is exactly why NixOS is getting much traction outside of enthusiasts and people with a lot of patience.
- rgoulter 4y agoMissing a 'not', I think? I think the idea that Nix is difficult to get started with, and undocumented, isn't a surprise to the community. -- These were some of the most repeated points in the community survey. And the topic of the submitted post. That said, I do think Nix has seen a lot of growth over the last year, and I see fewer "nix is so easy" comments.
- sph 4y agoI've been on the sidelines for a while, as I keep hearing that NixOS devs are focusing on the documentation for years now... but to be honest I'm not seeing it yet. Documentation was the thing that turned me off it 4 years ago, and I'm a bit sad to see it's still a big problem even if I keep hearing it's being actively worked on.
- rgoulter 4y agoThe easiest is to change the default: { avr ? true, arm ? true, teensy ? true }: Change `true` to `false` as needed, only keep the ones you need for you keyboard(s).
- rrgok 4y agoThank you, I will try again with your suggestions!
- ParetoOptimal 4y ago> 1. Does every nix-shell require building the whole world from ground-up? Seems impractical to me. Agreed! Most repos with a shell.nix and heavy dependencies use their own binary cache with the service cachix.org (free for public repos). > But, on MacOS, nixpkgs was not a pleasant experience at all. Were there reasons besides the QMK nix shell building the world?
- ParetoOptimal 4y ago> Agreed! Most repos with a shell.nix and heavy dependencies use their own binary cache with the service cachix.org (free for public repos). Created an issue: https://github.com/qmk/qmk_firmware/issues/18248 https://github.com/qmk/qmk_firmware/issues/18248
- 0x457 4y agoNix is source-first, but with binary cache. Many things have to be installed again on non-NixOS because nix is hermetic - it can't use library X from underlying system, it has to come from nix store. MacOS has issues with binary cache because of apple's requirement on where macOS can be run.