12 Aug 2021 |
@d4hines:matrix.org | * I'm getting the same error, obviously because I'm not telling home-manger "use this new nixpkgs" (there could be other mistakes too thought 😅) | 19:07:33 |
@d4hines:matrix.org | * I'm getting the same error, obviously because I'm not telling home-manger "use this new nixpkgs" (there could be other mistakes too though 😅) | 19:07:39 |
@timdeh:matrix.org | so I think the overlay should go in channels.<your-channel>.overlays | 19:08:16 |
@timdeh:matrix.org | based on whichever channel gets forward to home-manager | 19:08:28 |
@d4hines:matrix.org | In reply to @timdeh:matrix.org so I think the overlay should go in channels.<your-channel>.overlays Would you happen to have a link to docs describing this? | 19:08:53 |
@d4hines:matrix.org | I have trouble finding nix flake docs. | 19:09:09 |
@timdeh:matrix.org | this is a digga feature, so it should be documented here: digga.divnix.com | 19:12:21 |
@timdeh:matrix.org | oh wait, it looks like you are not using mkFlake | 19:12:50 |
@timdeh:matrix.org | so maybe not | 19:12:52 |
@d4hines:matrix.org | Right. I want to do this without libraries first, then refactor as necessary. | 19:13:08 |
@d4hines:matrix.org | Still trying to wrap my head around nix, flakes, etc. | 19:13:20 |
@timdeh:matrix.org | so by pulling pkgs from the module are here:
https://github.com/nrdxp/nixpkgs/blob/6dbf8c04097c8961bb1cb9cb319fee42eb19ab7a/nixos/modules/programs/zsh/zsh.nix#L288-L293
You are overiding the pkgs you declared in your let binding earlier | 19:13:42 |
@timdeh:matrix.org | * so by pulling pkgs from the module args here:
https://github.com/nrdxp/nixpkgs/blob/6dbf8c04097c8961bb1cb9cb319fee42eb19ab7a/nixos/modules/programs/zsh/zsh.nix#L288-L293
You are overiding the pkgs you declared in your let binding earlier | 19:13:51 |
@timdeh:matrix.org | does home-manager have a way to override the global pkgs? I doesn't look like it from the docs. In that case, it looks like you'd wanna throw your overlay in nixpkgs.overlays | 19:16:17 |
@d4hines:matrix.org | In reply to @timdeh:matrix.org does home-manager have a way to override the global pkgs? I doesn't look like it from the docs. In that case, it looks like you'd wanna throw your overlay in nixpkgs.overlays There's an attribute called overlay in the flake schema. I don't put it in there? | 19:18:29 |
@timdeh:matrix.org | You could do that, and then import it into home-manager by referencing it from self | 19:18:51 |
@timdeh:matrix.org | digga's mkFlake does this for you, but if your building from scratch you'd have to wire that up yourself | 19:19:08 |
@timdeh:matrix.org | so basically the way you have it now, you could just add a nixpkgs.overlays = [ self.overlay ] | 19:19:55 |
@timdeh:matrix.org | to your home-manager module | 19:20:06 |
@d4hines:matrix.org | That doesn't quite make sense to me. So here's what you're suggesting (correct if wrong)
- add the
overlay attribute to the flake.
- in the
configuration attribute of the object passed to homeManagerConfiguration , I add something like this:
configuration = { config, pkgs, ... }: {
nixpkgs.overlays = [ self.overlay ];
}
What confuses me about this is that I'm still using the pkgs argument in configuration elsewhere in the function. My intuition says that I should modify pkgs by applying the overlay to it.
| 19:26:05 |
@timdeh:matrix.org | That's what nixpkgs.overlays does under the hood | 19:26:59 |
@timdeh:matrix.org | so nixos has a nixpkgs.pkgs option where you can just build the global pkg set and it will be passed in to every module. Home-manager doesn't seem to have this, but it does have nixpkgs.config and nixpkgs.overlays, which would be applied to the underlying package set and passed in to every module as pkgs | 19:27:56 |
@d4hines:matrix.org | I get dependency injection but this seems convoluted. It also seems purely conventional - its' just convention that the prop called nixpkgs.overlays gets picked up by home-manager, applied to nixpkgs, and the result is passed to each module, right? | 19:30:35 |
@d4hines:matrix.org | Am I missing a piece, or is it something I get used to as I go along? | 19:32:27 |
ultranix | I still don't understand how to add profiles/suites to a home.users.<user> in flake.nix, | 19:32:53 |
@timdeh:matrix.org | are you already familiar with how to use them for nixos? it should be basically the same | 19:34:22 |
@d4hines:matrix.org | In reply to @ultranix:matrix.org I still don't understand how to add profiles/suites to a home.users.<user> in flake.nix, I'm not sure if this example would be helpful to you but here's I'm doing it https://github.com/d4hines/devos/blob/hope/flake.nix#L103 | 19:34:26 |
@d4hines:matrix.org | In reply to @timdeh:matrix.org so basically the way you have it now, you could just add a nixpkgs.overlays = [ self.overlay ] The wiki lists overlay as a valid attribute of flakes; however, I'm getting this error:
error: flake 'git+file:///home/d4hines/repos/beth' has an unsupported attribute 'overlay', at /nix/store/9cdyiyw5333969j5rhyrc3112kl2wkcv-source/flake.nix:4:3
| 19:37:06 |
@d4hines:matrix.org | https://nixos.wiki/wiki/Flakes#Output_schema | 19:37:21 |
@d4hines:matrix.org | Oh, it's an attribute of the output object | 19:38:08 |