My environment is MacOs Big Sur, with nix v2.3.14.
I got a new laptop that I want to setup without Homebrew and I’ve heard about Nix for a long time, this seems to be the perfect opportunity to try it.
I’ve been able to install a few tools already, but I’ve trouble installing GUI Applications, such as Obsidian and iTerm2. iTerm at least seem to be installed in ~/.nix-profile/Applications, while Obsidian is not installed. None of those Applications is found by Spotlight.
I’m newbie to Nix and my understanding is that the applications are installed but Spotlight does not locate them as those applications are just symlinked and there are issues for this both in nix and home-manager repos.
There seem to be a few workarounds mentioned in the issues above, but as I’m a newbie to Nix, I have no clue what to do to fix my situation, i.e how to use those workarounds ?
By the way, thanks to @Atemu for mentioning this Discourse via (Automatically link macOS applications to ~/Applications · Issue #956 · NixOS/nix · GitHub), I’ve tried to fix my situation by following the instructions and I’ve create a local copy of https://github.com/Atemu/home-manager/blob/e6d905336181ed8f98d48a1f6c9965b77f18e304/modules/targets/darwin.nix and linked it from my imports in my nix config (~/.nixpkgs/darwin-configuration.nix).
{ config, pkgs, ... }:
{
imports = [
darwin.nix # https://github.com/Atemu/home-manager/blob/e6d905336181ed8f98d48a1f6c9965b77f18e304/modules/targets/darwin.nix
];
...
But when I try to load this config, I face a few errors that I don’t know how to fix, being a Nix newbie
morganwattiez@Morgans-MBP> darwin-rebuild switch
building the system configuration...
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error: undefined variable 'darwin' at /Users/morganwattiez/.nixpkgs/darwin-configuration.nix:6:5
(use '--show-trace' to show detailed location information)
Should I install the home-manager version by @Atemu at GitHub - Atemu/home-manager: Development fork, don't depend on this. fix the issue or just copy https://github.com/Atemu/home-manager/blob/e6d905336181ed8f98d48a1f6c9965b77f18e304/modules/targets/darwin.nix and try to add it to imports ? Is there another solution I’m missing maybe ?
Thanks in advance