!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1180 Members
β€œThere are still many issues with the Darwin platform but most of it is quite usable.” β€” http://yves.gnu-darwin.org194 Servers

Load older messages


SenderMessageTime
21 Jan 2026
@eveeifyeve:matrix.orgeveeifyeveHardware accelerated, but the real question is that if it uses https://developer.apple.com/documentation/virtualization13:06:49
@k900:0upti.meK900Why does that matter exactly?13:07:25
@eveeifyeve:matrix.orgeveeifyeve* Hardware accelerated could still mean emulated, but the real question is that if it uses https://developer.apple.com/documentation/virtualization13:07:27
@ihar.hrachyshka:matrix.orgIhar HrachyshkaIt's accelerated and performant enough, at one point I did my Linux development in a nixpkgs VM, ran kind clusters and such.13:07:32
@eveeifyeve:matrix.orgeveeifyevehttps://determinate.systems/blog/changelog-determinate-nix-384/#why13:08:27
@k900:0upti.meK900 And? 13:08:57
@steve_in_the_matrix:matrix.orgSteve

Hi there, I'm attempting to create an installation image using nix-community/nixos-generators on macOS, but I'm encountering strange issues related to my "$HOME" environment variable. When I execute nix build as a regular user, it reports that $HOME is set to "/build", which is not the case. However, when I "sudo nix build", it reports that $HOME is set to my user directory (not root?). Nevertheless, it then complains that the directory is not owned by root.

Has anyone encountered such unusual behavior before? I'm at a loss for what to do. I would greatly appreciate any insights or suggestions you may have. Thank you in advance for your assistance.

13:10:54
@k900:0upti.meK900I'd be really surprised if that actually works on a Darwin host tbh13:11:24
@saiko:knifepoint.netKatalin πŸ”ͺ sudo does not reset $HOME 13:12:17
@saiko:knifepoint.netKatalin πŸ”ͺ add -i 13:12:18
@ihar.hrachyshka:matrix.orgIhar HrachyshkaI did use nixos-generators on Darwin to create virtualbox images. Why wouldn't it work?13:12:54
@k900:0upti.meK900Because you'd have to build some NixOS bits presumably?13:13:32
@steve_in_the_matrix:matrix.orgSteveThat's exactly what I'm trying to do. Just for UTM.13:13:42
@ihar.hrachyshka:matrix.orgIhar HrachyshkaOh sure but you always have a Linux builder.13:14:00
@eveeifyeve:matrix.orgeveeifyeveLooking at QEMU source code, it unfortunately doesn't.13:14:01
@k900:0upti.meK900 I am still confused why you think this even matters 13:14:15
@k900:0upti.meK900I don't know what exactly it does13:14:21
@k900:0upti.meK900But it does not introduce major CPU overhead13:14:29
@k900:0upti.meK900So I'm not sure what your problem is13:14:33
@steve_in_the_matrix:matrix.orgSteve-i brings "unrecognized flag". I'm using determinate Nix. Is that maybe the problem?13:14:39
@saiko:knifepoint.netKatalin πŸ”ͺ (but I do wonder why nix build also doesn't reset $HOME. I think usually it should be set to /homeless-shelter. probably doesn't do that when the sandbox is disabled?) 13:14:40
@saiko:knifepoint.netKatalin πŸ”ͺ sudo -i 13:14:47
@steve_in_the_matrix:matrix.orgSteve

That's the output:

sudo determinate-nixd upgrade
You are already running the latest version of Determinate Nix (3.15.1).

echo $HOME
/Users/bob

nix build -L .#nixosConfigurations.installer-aarch64.config.formats.qcow-efi
evaluating derivation 'git+file:///Users/bob/coding#nixosConfigurations.installer-aarch64.config.formats.qcow-efi'
nixos-disk-image> warning: $HOME ('/build') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/empty')
nixos-disk-image> chmod: changing permissions of '/build': Operation not permitted
error: Cannot build '/nix/store/ylpcrwmdbr3f4q1sqjvdi8a2nbz671r2-nixos-disk-image.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/6sbfv1lzjmr6aldy423x0gjplvwqhajk-nixos-disk-image
Last 2 log lines:
> warning: $HOME ('/build') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/empty')
> chmod: changing permissions of '/build': Operation not permitted
...
error: Build failed due to failed dependency

sudo nix build -L .#nixosConfigurations.installer-aarch64.config.formats.qcow-efi
warning: $HOME ('/Users/bob') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
warning: $HOME ('/Users/bob') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
nixos-disk-image> warning: $HOME ('/build') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/empty')
nixos-disk-image> chmod: changing permissions of '/build': Operation not permitted
...
error: Build failed due to failed dependency

13:15:25
@saiko:knifepoint.netKatalin πŸ”ͺ well okay that's not the problem then 13:15:49
@saiko:knifepoint.netKatalin πŸ”ͺ these are just warnings and it picks the correct one (-ish) anyway 13:16:02
@eveeifyeve:matrix.orgeveeifyeveQEMU can offer slower speeds when on a arm host than using the native framework that is optimized for apple hardware.13:16:12
@saiko:knifepoint.netKatalin πŸ”ͺ > chmod: changing permissions of '/build': Operation not permitted

this is the problem
13:16:21
@k900:0upti.meK900 Have you actually measured this 13:16:22
@k900:0upti.meK900Because like13:16:25
@k900:0upti.meK900No13:16:26

Show newer messages


Back to Room ListRoom Version: 6