Hello, I have a new M2 MacBook and just installed Nix with Determinate’s graphical Nix Darwin installer. That part worked fine, as does creating the first flake.nix with nix flake init -t nix-darwin
. But when I the run nix run nix-darwin -- switch --flake .
I get these errors:
byrongibson@MacBook-Pro-2 config % nix run nix-darwin -- switch --flake .
error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused
byrongibson@MacBook-Pro-2 config % sudo nix run nix-darwin -- switch --flake .
warning: $HOME ('/Users/byrongibson') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
warning: $HOME ('/Users/byrongibson') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
warning: creating lock file '/Users/byrongibson/nix/darwin/config/flake.lock':
• Added input 'nix-darwin':
'github:LnL7/nix-darwin/3ac7acd32db4f7111015e8d5349ff6067df01bf6' (2024-01-21)
• Added input 'nix-darwin/nixpkgs':
follows 'nixpkgs'
• Added input 'nixpkgs':
'github:NixOS/nixpkgs/e5d1c87f5813afde2dda384ac807c57a105721cc' (2024-01-19)
building the system configuration...
warning: $HOME ('/Users/byrongibson') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
error: flake 'path:/Users/byrongibson/nix/darwin/config?lastModified=1705811073&narHash=sha256-SKstJL21bfvtgqveKIGwpXeIZethgabPbVvp0McnTUU%3D' does not provide attribute 'packages.aarch64-darwin.darwinConfigurations.MacBook-Pro-2.system', 'legacyPackages.aarch64-darwin.darwinConfigurations.MacBook-Pro-2.system' or 'darwinConfigurations.MacBook-Pro-2.system'
byrongibson
is the system’s main Admin user. The only changes I made to the default flake are:
....
# The platform the configuration will be used on.
#nixpkgs.hostPlatform = "x86_64-darwin";
nixpkgs.hostPlatform = "aarch64-darwin";
};
in
{
# Build darwin flake using:
# $ darwin-rebuild build --flake .#simple
#darwinConfigurations."simple" = nix-darwin.lib.darwinSystem {
darwinConfigurations."MacBook-Pro-2.attlocal.net" = nix-darwin.lib.darwinSystem {
modules = [ configuration ];
};
# Expose the package set, including overlays, for convenience.
#darwinPackages = self.darwinConfigurations."simple".pkgs;
darwinPackages = self.darwinConfigurations."MacBook-Pro-2.attlocal.net".pkgs;
};
Anyone see what I’m doing wrong here?