Skip to content
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

fix home.activation.checkLinkTargets #19

Closed

Conversation

dermetfan
Copy link
Collaborator

@dermetfan dermetfan commented Jul 6, 2017

Problem

We resolve symlinks from inside /nix/store/HASH-home-manager-files into the nix store as /nix/store/HASH-DRVNAME which does not match the pattern.

This happened to me because I pull in some repos in via home.file. The home-manager-files derivation links to the repo's derivation in the nix store. For example:

let nanorcs = fetchFromGitHub {
  owner = "scopatz";
  repo = "nanorc";}; in [
  {
    target = ".nano";
    source = nanorcs;
  }
  {
    target = ".nanorc";
    source = "${nanorcs}/nanorc";
  }
]

Solution

Call readlink without -e to obtain only the first redirection from ~ to /nix/store/HASH-home-manager-files.

Why a PR?

I am unsure why you used -e but saw you using it consistently. Is there an edge case I failed to notice?

======================================

Problem
-------

We resolve symlinks from inside `/nix/store/HASH-home-manager-files` into the nix store as `/nix/store/HASH-DRVNAME` which does not match the pattern.

This happened to me because I pull in some repos in via `home.file`. The `home-manager-files` derivation links to the repo's derivation in the nix store. For example:

    let nanorcs = fetchFromGitHub {
      owner = "scopatz";
      repo = "nanorc";
      …
    }; in [
      {
        target = ".nano";
        source = nanorcs;
      }
      {
        target = ".nanorc";
        source = "${nanorcs}/nanorc";
      }
    ]

Solution
--------

Call `readlink` without `-e` to obtain only the first redirection from `~` to `/nix/store/HASH-home-manager-files`.
@rycee
Copy link
Member

rycee commented Jul 7, 2017

Thanks for reporting :-) I think this might be a copy-paste mistake. I know that -e is required elsewhere but it may not be the case here. I will have a closer look tomorrow (and also your other PR).

@rycee
Copy link
Member

rycee commented Jul 7, 2017

Yeah, in this case it definitely should be without -e. The problem only manifests itself when using home.file.blah.source = ./foo; where ./foo is a directory. Rebased this into master in cb569c5. Many thanks for catching and fixing this bug!

@rycee rycee closed this Jul 7, 2017
@dermetfan dermetfan deleted the fix/checkLinkTargets branch July 10, 2017 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants