Skip to content

home.file.<name>.source cannot begin with a dot #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dermetfan opened this issue Feb 21, 2017 · 2 comments
Closed

home.file.<name>.source cannot begin with a dot #4

dermetfan opened this issue Feb 21, 2017 · 2 comments

Comments

@dermetfan
Copy link
Collaborator

dermetfan commented Feb 21, 2017

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>;.

@rycee rycee closed this as completed in a390034 Feb 21, 2017
@rycee
Copy link
Member

rycee commented Feb 21, 2017

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!

@eqyiel
Copy link
Contributor

eqyiel commented Aug 11, 2018

@rycee @dermetfan check out this workaround: NixOS/nix#912 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants