nixos-homepage icon indicating copy to clipboard operation
nixos-homepage copied to clipboard

error building homepage on macos

Open bxrt opened this issue 5 years ago • 5 comments
trafficstars

Following the instructions on https://github.com/NixOS/nixos-homepage to build the homepage as a novice Nix user I get the following error:

$ git clone https://github.com/bxrt/nixos-homepage.git
Cloning into 'nixos-homepage'...
remote: Enumerating objects: 425, done.
remote: Counting objects: 100% (425/425), done.
remote: Compressing objects: 100% (247/247), done.
remote: Total 5450 (delta 242), reused 340 (delta 176), pack-reused 5025
Receiving objects: 100% (5450/5450), 17.09 MiB | 8.01 MiB/s, done.
Resolving deltas: 100% (3329/3329), done.
$ cd nixos-homepage/
$ nix-shell
unpacking 'https://github.com/edolstra/flake-compat/archive/master.tar.gz'...
error: nix-shell requires a single derivation
Try 'nix-shell --help' for more information.

This is on macOS.

bxrt avatar Sep 04 '20 11:09 bxrt

It works on NixOS 20.03.2868.ff6a070b4ef with Nix 2.3.6. @bxrt which Nix version do you use and which channel?

davidak avatar Sep 20 '20 23:09 davidak

@davidak @bxrt this is a macos specific problem.

Our current build system is quite complex since it even requires - sometimes - building Nix. There are few toolchains that are currently used to pull all of the different manuals in. We intentionally didn't put any effort into fixing this situation, not until the format and the tooling is decided for Nix/Nixpkgs/NixOS (in RFC #72).

Once format and tooling is decided for documentation we will try to use it also for the website, just to keep things simple. Of-course if we will see that using those tools requires too much hacking around then we would look for something else.

I would only tackle building on macos once we switch to new tooling, which would hopefully be easier to do. I hope you understand this, limited time and getting page in the best shape possible is a priority. But I would happily look at any PR if you decide to tackle this problem.

@bxrt In the meantime either use some linux builder via docker or even give nixbuild.net a try. In the worse case you can submit the PR and see if it builds.

garbas avatar Sep 21 '20 07:09 garbas

maybe we should document how to build the docs in a docker container on macos? or wouldn't that work either for some reason?

raboof avatar Sep 24 '20 08:09 raboof

I had success building the docs in a docker on macOS. Prerequisite: Docker Desktop for Mac. In the terminal: docker run -p 8000:8000 -it --name nixos-homepage nixos/nix

Still in the terminal, but on the prompt of the running container:

# nix-shell -p git
[nix-shell]$ git clone https://github.com/NixOS/nixos-homepage.git
[nix-shell]$ cd nixos-homepage
[nix-shell]$ nix-shell
[nix-shell]$ make
[nix-shell]$ python -m http.server --bind 0.0.0.0

Then browse to http://localhost:8000/ in the browser (Safari or Chrome) on MacOS.

(@garbas, I can see why you would want to simplify the toolchain, building included building cargo (The Rust package manager) and the go compiler.)

bxrt avatar Sep 25 '20 10:09 bxrt

@bxrt could you add this to the README as an option when you are running on macos?

garbas avatar Sep 25 '20 12:09 garbas