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

Install as overlay? #111

Open
danbst opened this issue Jan 21, 2019 · 3 comments
Open

Install as overlay? #111

danbst opened this issue Jan 21, 2019 · 3 comments

Comments

@danbst
Copy link

danbst commented Jan 21, 2019

For me it works like this.

self: super:
let nur = import /home/danbst/dev/NUR { nurpkgs = self; pkgs = self; };
in {
    nur = nur;
}

I guess remark in the end describes why nix-community/NUR isn't composed as list of overlays, but for a newcomer (like me) it reads as "don't use NUR in overlay".

Also, publishing NUR as an overlay poses no security problems:

let
  danbst_overlay = self: super: {
    repos.danbst.mypkg = self.writeText "hello.txt" "hello world";
  };
  hacker_overlay = self: super: {
    repos.danbst.mypkg = self.writeText "hello.txt" "pwned";
  };
in self: super: {
  # this must be autogenerated
  repos.danbst = with danbst_overlay self super; repos.danbst or {};
  repos.hacker = with hacker_overlay self super; repos.hacker or {};  
}

$ cat $(nix-build '<nixpkgs>' -A repos.danbst.mypkg)
hello world
@danbst danbst mentioned this issue Jan 21, 2019
2 tasks
@Mic92
Copy link
Member

Mic92 commented Jan 28, 2019

There is a problem with evaluating untrusted nix code, probably in conjunction with nix-env -q or nix search. It could leak environment variables.

@danbst
Copy link
Author

danbst commented Jan 28, 2019

@Mic92 can you explain a bit more? In which case overlay is "less secure" then current situation?

@Mic92
Copy link
Member

Mic92 commented Jan 28, 2019

It is not less secure, but it is also not more secure.
You can use it as an overlay if you want, I just don't see any advantages over the usage proposed in the README. I don't think you can compose different repositories at random because there is no coordination between those, so it is likely to
break. In your example you also use repositories independent from each other.

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

2 participants