Mac applications installed by Nix are not loaded by Spotlight

What you wrote got interpreted as “attribute nix of the attrset called darwin” which is what Nix also tells you; it has no idea what this darwin variable refers to since no such variable exists.
This is why paths must be either absolute or explicitly relative: darwin.nix./darwin.nix.

You should not use my home-manager fork directly, no. There is no maintenance being done on it.

Vendoring it like you did is fine in this case, though you could also fetch just that module:

builtins.fetchurl {
  url = "https://raw.githubusercontent.com/Atemu/home-manager/e6d905336181ed8f98d48a1f6c9965b77f18e304/modules/targets/darwin.nix";
  sha256 = "0lsa8ncwvv5qzar2sa8mxblhg6wcq5y6h9ny7kgmsby4wzaryz67";
}

so

{ config, pkgs, ... }:

{
  imports = [
    (builtins.fetchurl {
      url = "https://raw.githubusercontent.com/Atemu/home-manager/e6d905336181ed8f98d48a1f6c9965b77f18e304/modules/targets/darwin.nix";
      sha256 = "0lsa8ncwvv5qzar2sa8mxblhg6wcq5y6h9ny7kgmsby4wzaryz67";
    })
  ];
}

Note that all of this might be unnecessary very soon thanks to @wmertens’ suggestion. I’ve got a prototype working but it still has some kinks.

1 Like