srid / nixos-flake

A flake-parts module to manage NixOS and macOS machines, along with home-manager support, in a unified fashion.
https://community.flake.parts/nixos-flake
MIT License
170 stars 18 forks source link

`macOS` template does not work out of the box #52

Open srid opened 1 month ago

srid commented 1 month ago

For the macOS only template when used on a new Mac Studio: https://community.flake.parts/nixos-flake/templates#macos

image
srid commented 1 month ago

To solve this, I simply added services.nix-daemon.enable = true;, but now the installation fails with:

image

The documentation should be clear on what to do here.

I probably should add some of these to the template (shared with all templates):

https://github.com/srid/nixos-config/blob/f1e560296d62c192c6a1a1dd1ca54c237a2cbf96/nixos/nix.nix#L15-L26

srid commented 1 month ago

And then, after moving existing nix.conf out of the way:

sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
nix run .#activate --extra-experimental-features 'nix-command flakes'

which almost completes before hitting:

image
srid commented 1 month ago

That required adding the following to nix-darwin config,

users.users.nix-infra.home = "/Users/nix-infra";

Ref: https://github.com/srid/nixos-config/blob/f1e560296d62c192c6a1a1dd1ca54c237a2cbf96/systems/darwin.nix#L23-L27

After this, activation succeeds.

srid commented 1 month ago

Another issue:

Zhen-hao commented 22 hours ago
  • Home-manager installed programs are not accessible in $PATH

Hi @srid, did you find a solution for it? I now have the same issue.

srid commented 21 hours ago

@Zhen-hao For now, I setup PATH manually in my config:

https://github.com/srid/nixos-config/blob/a6931860fdc14495c074a3d637ebe71afe069264/home/zsh.nix#L16-L17

Regardless, we should update the nixos-flake templates so that they "just work".