DeterminateSystems / zero-to-nix

Zero to Nix is your guide to learning Nix and flakes. Created by Determinate Systems.

Home Page:https://zero-to-nix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I immediately got lost trying to setup home-manager, zero-to-nix could use a home-manager setup page

lamont-granquist opened this issue · comments

Tried to go from the zero-to-nix documentation to installing and using home-manager and haven't had any success with the linked blog post: https://www.bekk.christmas/post/2021/16/dotfiles-with-nix-and-home-manager or this more recent one: https://juliu.is/tidying-your-home-with-nix/

The command nix run . switch at the start gave me this:

No configuration file found. Please create one at ~/.config/home-manager/home.nix

I setup a link from that to pwd/home.nix where I was working and got past that, but then run into various bugs including with an initial home-manager switch:

error: file 'home-manager/home-manager/home-manager.nix' was not found in the Nix search path (add it using $NIX_PATH or -I)

       at «none»:0: (source not available)

That seems to be a fixed bug with nixpkgs, so I'm not sure why I'm hitting it: NixOS/nixpkgs#247252

When I try it as nix run home-manager switch I get something totally different:

error:
       … while evaluating the attribute 'activationPackage'

         at /nix/store/s9hqca29ncnqq73jkigk2c95bnwkn2pj-source/modules/default.nix:54:3:

           53|
           54|   activationPackage = module.config.home.activationPackage;
             |   ^
           55|

       … while evaluating a branch condition

         at /nix/store/j0jlb33bm31w347w43051hbffgh616jr-source/lib/lists.nix:57:9:

           56|       fold' = n:
           57|         if n == len
             |         ^
           58|         then nul

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: The option `programs.sl' does not exist. Definition values:
       - In `/Users/lamont/nix/home.nix':
           {
             enable = true;
           }

Also when trying to follow the nix manual instructions on how to update nix on macos I get this:

% sudo -i sh -c 'nix-channel --update && nix-env --install --attr nixpkgs.nix && launchctl remove org.nixos.nix-daemon && launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist'
Password:
unpacking channels...
error: attribute 'nixpkgs' in selection path 'nixpkgs.nix' not found

Little bit frustrated today so I'm probably moving on to other things I have to do and will circle around later to see where things stand in a few months, but hopefully I've convinced you that there's a need for a zero-to-nix page on installing home-manager which is always-up-to-date and it doesn't rely on random blog pages which don't use the determinate nix installer.

Yeah that linked blog post is both out of date and includes basic syntax errors. It should be removed. The zero-to-nix tutorial is excellent and then it refers you to a blog post that is broken in multiple ways. Bad.