| 12 Aug 2021 |
@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 |
@timdeh:matrix.org | oh yes, I didn't notice that. The top-level attributes in a flake.nix should only be description inputs outputs and nixConfig. | 19:39:52 |
yusdacra | error: builder for '/nix/store/2hazs71krc2dkcc6qh6iq2cf46h7a4bm-nix-2.4pre20210802_47e96bb.drv' failed with exit code 1;
last 10 log lines:
> Hunk #6 succeeded at 496 (offset 8 lines).
> Hunk #7 succeeded at 512 (offset 8 lines).
> Hunk #8 succeeded at 531 (offset 8 lines).
> 1 out of 8 hunks FAILED -- saving rejects to file src/libexpr/flake/flake.cc.rej
> patching file src/libexpr/flake/flake.hh
> Hunk #2 succeeded at 124 (offset 4 lines).
> patching file src/libfetchers/fetchers.hh
> patching file src/libfetchers/path.cc
> patching file tests/flakes.sh
> Hunk #2 succeeded at 686 (offset -56 lines).
For full logs, run 'nix log /nix/store/2hazs71krc2dkcc6qh6iq2cf46h7a4bm-nix-2.4pre20210802_47e96bb.drv'.
| 19:40:08 |
@timdeh:matrix.org | outputs being the meat of it | 19:40:11 |
yusdacra | i'm getting this with latest nixpkgs-unstable | 19:40:17 |
yusdacra | i guess the patches are out of date now | 19:40:24 |
@timdeh:matrix.org | I think the patches are only for the nix in the shell though right David Arnold (blaggacao) | 19:41:01 |
@timdeh:matrix.org | I just updated nix to master since I recently merged a version bump and it's working on my system. Even with nix-dram applied | 19:41:34 |
yusdacra | hmm | 19:41:49 |
yusdacra | i think i can build the system fine | 19:42:19 |
yusdacra | its just the devshell | 19:42:23 |
David Arnold (blaggacao) | In reply to @d4hines:matrix.org Right. I want to do this without libraries first, then refactor as necessary. I empathically understand the impetus. However, if you ask me, it might be easier the other way round.. 🙂 | 19:44:06 |
@kraftnix: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, if you are using master, you should have some suites under home.importables.suites, then you reference these in a user under ./users/kraftnix/default.nix or ./users/kraftnix.nix and do something like
home-manager.users.kraftnix = { suites, ... }: {
imports = with suites; base ++ tokyo-night;
...
};
where the above pulls in a suite I have called base and tokyo-night, at least that's how I use user profiles
| 19:44:36 |
@timdeh:matrix.org | In reply to @yusdacra:nixos.dev i think i can build the system fine yeah, it's just used in the shell because of the follows bug. Hopefully they merge that PR soonish so we can remove the patches all together | 19:45:51 |