home.nix: path with '~' can not be resolved in pure mode #22

Open
opened 2024-11-13 09:19:34 -05:00 by pjaglom · 3 comments
pjaglom commented 2024-11-13 09:19:34 -05:00 (Migrated from github.com)

I tried to follow your youtube tutorial on dotfile management with nix and home-manager, but when I try to follow your home-manager home.nix configuration, I get the following error message:

error: the path '~/.dotfiles/zshrc/.zshrc' can not be resolved in pure mode

I also tried an absolute path /Users/<my_username> and a relative path after moving my dotfile directory inside my nix-darwin directory, but the former didn't work either and the latter caused deletion issues of the dotfile repo when it replaced my nix-darwin directory.

Do you use impure evaluation with nix-darwin/home-manager? Is there another way around this error?

I tried to follow your youtube tutorial on dotfile management with nix and home-manager, but when I try to follow your home-manager home.nix configuration, I get the following error message: ``` error: the path '~/.dotfiles/zshrc/.zshrc' can not be resolved in pure mode ``` I also tried an absolute path `/Users/<my_username>` and a relative path after moving my dotfile directory inside my nix-darwin directory, but the former didn't work either and the latter caused deletion issues of the dotfile repo when it replaced my nix-darwin directory. Do you use impure evaluation with nix-darwin/home-manager? Is there another way around this error?
ekarious commented 2024-11-20 16:49:28 -05:00 (Migrated from github.com)

I actually got the same problem. Trying to solve it right now.
Did you find a solution ?

I actually got the same problem. Trying to solve it right now. Did you find a solution ?
ekarious commented 2024-11-20 18:55:08 -05:00 (Migrated from github.com)

Found it.

you can make it work in this way

".zshrc".source = config.lib.file.mkOutOfStoreSymlink "/Users/<username>/.dotfiles/zshrc/.zshrc;

Do not forget to change the username, maybe the use of $HOME might work here now.

Found it. you can make it work in this way ``` ".zshrc".source = config.lib.file.mkOutOfStoreSymlink "/Users/<username>/.dotfiles/zshrc/.zshrc; ``` Do not forget to change the username, maybe the use of $HOME might work here now.
franco-grobler commented 2025-07-22 17:53:56 -04:00 (Migrated from github.com)

Using the HOME env variable works as well.

Using the HOME env variable works as well.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
omerxx/dotfiles#22
No description provided.