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

Adding the overlay of a nix flake #28

Closed
jokogr opened this issue Dec 10, 2020 · 4 comments · Fixed by #42
Closed

Adding the overlay of a nix flake #28

jokogr opened this issue Dec 10, 2020 · 4 comments · Fixed by #42
Labels
question Further information is requested

Comments

@jokogr
Copy link
Contributor

jokogr commented Dec 10, 2020

👋 This template gave me the right boost to start porting my client machine configuration to flakes, many thanks!

I would like to add the overlay that another nix flake provides, e.g., nixpkgs-wayland.

What would be the most optimal way to do so? Since I am talking about packages that both system and user (via home-manager configuration) might use, I am particularly interested in a solution which addresses both cases.

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 10, 2020

The semantics for pulling overlays from other flakes should be improved, but for now anything added to nixflk's overlays output attribute is automatically added to the NixOS system overlays.

So simply wire the overlays from the repo you mentioned into said overlays attribute and they'll be available for you.

@nrdxp nrdxp closed this as completed Dec 10, 2020
@nrdxp nrdxp reopened this Dec 10, 2020
@jokogr
Copy link
Contributor Author

jokogr commented Dec 18, 2020

So simply wire the overlays from the repo you mentioned into said overlays attribute and they'll be available for you.

Sorry for my late comment to this, but it is still not totally clear to me how to do so. I saw the example of a custom overlay at https://github.com/nrdxp/nixflk/blob/993a79e61edeb811537927cbb504769013eaf37d/profiles/laptop/default.nix#L48-L61, but:

  1. AFAIK the flake as an attribute is not accessible to profiles, i.e., one has to use it at hosts/default.nix.
  2. Should the nixpkgs-overlays path in NIX_PATH defined there be updated somehow?

In the end I've added the overlay in the overrides section there, but I would like to hear other people's opinion on that.

@nrdxp
Copy link
Collaborator

nrdxp commented Dec 19, 2020

Right here. Something like:

overlays = (attrValues self.overlays) ++ [ 
  otherFlake.overlays.yourOverlay
];

I'm thinking about adding an internal "extras" flake that is not exposed to the outside world but is wired into the default config so adding things from other flakes can be less painful. Until then, this should do.

@nrdxp nrdxp added the question Further information is requested label Dec 20, 2020
@jokogr jokogr closed this as completed Dec 22, 2020
@nrdxp
Copy link
Collaborator

nrdxp commented Dec 25, 2020

I'm reopening to close with a PR I am about to submit. Essentially, I have added an externOverlays in flake.nix to which you can easily add your external overlays and they will be available for your NixOS configurations.

@nrdxp nrdxp reopened this Dec 25, 2020
nrdxp added a commit that referenced this issue Dec 25, 2020
Fixes #28 by adding an `externOverlays` list to easily import overlays
from external flakes.
nrdxp added a commit that referenced this issue Dec 25, 2020
Fixes #28 by adding an `externOverlays` list to easily import overlays
from external flakes.
@nrdxp nrdxp closed this as completed in #42 Dec 25, 2020
blaggacao pushed a commit to blaggacao/devos that referenced this issue Jul 6, 2021
Fixes divnix#28 by adding an `externOverlays` list to easily import overlays
from external flakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants