To reproduce:
# ~/.nixpkgs/home.nix
home.file.test.source = ./.test;
⯠home-manager build
error: while evaluating the attribute āinstallPhaseā of the derivation āhome-manager-generationā at /home/dermetfan/.nixpkgs/home-manager/modules/home-environment.nix:333:11:
while evaluating the attribute āinstallPhaseā of the derivation āhome-manager-filesā at /home/dermetfan/.nixpkgs/home-manager/modules/home-environment.nix:319:11:
while evaluating anonymous function at /nix/store/7k3jyxd0y4c6hnl4ixs1yz1d1pvplgf1-nixos-17.03pre101636.183eeb3/nixos/lib/attrsets.nix:224:10, called from undefined position:
while evaluating anonymous function at /home/dermetfan/.nixpkgs/home-manager/modules/home-environment.nix:326:37, called from /nix/store/7k3jyxd0y4c6hnl4ixs1yz1d1pvplgf1-nixos-17.03pre101636.183eeb3/nixos/lib/attrsets.nix:224:16:
illegal name: ā.testā
The evaluation error occurs when ${value.source} is accessed.
My workaround for now is home.file.".<name>" = ./dotfiles/<name>;.
Interesting discovery! Unfortunately there is not much I can do to allow files whose name start with ., this is a hard limit within Nix itself.
The message can, however, be a bit more intuitive. With the commit above the configuration
{
home.file.".test".source = ./.test;
}
will now yield the error message
rycee@beta:~$ home-manager -f .nixpkgs/beta.nix -I nixpkgs=/home/rycee/devel/nixpkgs-stable-rycee build
error:
Failed assertions:
- Source file names must not start with '.': /home/rycee/devel/nixos-config/user/.test
(use ā--show-traceā to show detailed location information)
rycee@beta (ā 1):~$
Thank you for the report!
@rycee @dermetfan check out this workaround: https://github.com/NixOS/nix/issues/912#issuecomment-412244869
Most helpful comment
@rycee @dermetfan check out this workaround: https://github.com/NixOS/nix/issues/912#issuecomment-412244869