Closed ignatiusm closed 1 year ago
Can you export your current environment and share the result?
$ env
Sure (thanks for a speedy reply! π )
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/zsh
TERM=xterm-256color
TMPDIR=/var/folders/dc/cnzrbwx50_1cpdmxz839vmg00000gn/T/
TERM_PROGRAM_VERSION=452
TERM_SESSION_ID=85D518F6-96F9-4D08-B771-54C1A1F1B752
USER=iggy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.zytT31kHRe/Listeners
PATH=/Users/iggy/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
LaunchInstanceID=22FE9B71-CEF3-4A7E-9F56-5D06035F31F3
__CFBundleIdentifier=com.apple.Terminal
PWD=/Users/iggy/nixos-config
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/iggy
LOGNAME=iggy
SECURITYSESSIONID=186b4
OLDPWD=/Users/iggy/nixos-config
NIX_PROFILES=/nix/var/nix/profiles/default /Users/iggy/.nix-profile
NIX_SSL_CERT_FILE=/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt
LANG=en_NZ.UTF-8
_=/usr/bin/env
@dustinlyons - I tried again with nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin";
in the inputs block of flake.nix
and it got past that error!! π
Currently in the "Switching to new generation" and installing phases.
I see you use your own fork of nixpkgs. How does my somewhat hacky fix fit in with that pattern?
Again, thank you very much for all the hard work you've put into making your config easily sharable π
@ignatiusm That's great to hear! My fork provides a few options:
So you'll be fine if you're sticking with Mac.
In re: to your error, I was able to reproduce it! So that's actually great. When I try to run bin/build
I now get the same thing. I only got the error after updating my flake locally to the latest nixpkgs
. So previous flake inputs worked, latest flake inputs don't.
This is a good introduction to Nix. This will happen from time to time; you'll update your dependencies and the build will break. But the amazing thing about nixpkgs
is someone is likely already on it! A patch is probably likely already in the works, the community is fast; all you have to do is wait, run nix flake update
, and build again.
nixpkgs
is amazing because it's like this massive community all patching software together :)
So, here's my general process when I update the flake and it doesn't build:
nixpkgs
Github Issues and search for the error. If nothing is there, I may submit oneoverlays/
dir that locks the bad package to a previous working commit hash.This is great because think about the past, when you get strange errors building dependencies: you're usually on your own. Here, we lean on the community of nixpkgs
.
I recently added CI to this repository; I need to do the same for nixpkgs
so that my fork doesn't update unless the template build passes. And need to procur a Mac Mini to run aarch64-darwin
. On the list :)
Looks like it's the docker
package failing to build. I commented out the lines docker
and docker-compose
in shared/packages.nix
and it builds.
Also, the reason nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin"
works for you is because whatever bug this is hasn't hit that input yet. My nixpkgs
fork grabs the latest commit hash.
I went ahead and submitted an issue for this: https://github.com/NixOS/nixpkgs/issues/267685 and disabled docker
in the configuration for now.
Someone released a patch to fix the issue, there is now an open PR: https://github.com/NixOS/nixpkgs/pull/267751
Thank you for your super informative and welcoming response!! I'm very grateful for your help and encouragement.
One question: how did you narrow it down to docker that was broken? It wasn't listed in the log snippet above as one of the pkgs that had glibc
as a dependency. Is there a command to see the tree of dependencies?
When I reproduced it locally, the log output showed docker
as the last derivation in the call stack. Usually it will show you the broken package at build time.
For tree of dependencies. you can play around with nix-tree
.
$ nix shell nixpkgs#nix-tree
$ cd nixos-config && nix-tree
Hi π Thanks for this excellent repository!
I wonder if you had any debugging advice for a nix-noob who is trying to set up nix on a fresh M2 MacBook Pro running Sonoma 14.1.1
I'm encountering an issue while running the build step of
bin/build
. To my eyes it looks likeglibc
isn't successfully building. It says the GNU C library is currently unavailable for this platform. I can see an entry for glibc on search.nixos.org (but, indeed, nodarwin
support). It gets through to theconfiguring
phaseMy question is: why do you think it is looking for
glibc
when doing a build on darwin? I've tried a few things (clean reinstall, adding gnugrep and glibc to list of packages, using NixOS/nixpkgs - main and unstable) but am a bit hampered by my Nix ignorance here. Do you have any suggestions for how to address this?