!UUqahLbShAYkkrXmKs:matrix.org

DevOS

37 Members
Seeking help and geeking out together on https://github.com/divnix/devos & https://github.com/divnix/digga10 Servers

Load older messages


SenderMessageTime
12 Aug 2021
@timdeh:matrix.org@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 earlier19:13:51
@timdeh:matrix.org@timdeh:matrix.orgdoes 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.overlays19:16:17
@d4hines:matrix.orgd4hines
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@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@timdeh:matrix.orgdigga's mkFlake does this for you, but if your building from scratch you'd have to wire that up yourself19:19:08
@timdeh:matrix.org@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@timdeh:matrix.orgto your home-manager module19:20:06
@d4hines:matrix.orgd4hines

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@timdeh:matrix.orgThat's what nixpkgs.overlays does under the hood19:26:59
@timdeh:matrix.org@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.orgd4hines 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.orgd4hinesAm I missing a piece, or is it something I get used to as I go along?19:32:27
@ultranix:matrix.orgultranixI still don't understand how to add profiles/suites to a home.users.<user> in flake.nix, 19:32:53
@timdeh:matrix.org@timdeh:matrix.orgare you already familiar with how to use them for nixos? it should be basically the same19:34:22
@d4hines:matrix.orgd4hines
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.orgd4hines
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.orgd4hineshttps://nixos.wiki/wiki/Flakes#Output_schema19:37:21
@d4hines:matrix.orgd4hinesOh, it's an attribute of the output object19:38:08
@timdeh:matrix.org@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:nixos.devyusdacra
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@timdeh:matrix.org outputs being the meat of it 19:40:11
@yusdacra:nixos.devyusdacrai'm getting this with latest nixpkgs-unstable19:40:17
@yusdacra:nixos.devyusdacrai guess the patches are out of date now19:40:24
@timdeh:matrix.org@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@timdeh:matrix.orgI just updated nix to master since I recently merged a version bump and it's working on my system. Even with nix-dram applied19:41:34
@yusdacra:nixos.devyusdacrahmm19:41:49
@yusdacra:nixos.devyusdacrai think i can build the system fine19:42:19
@yusdacra:nixos.devyusdacraits just the devshell19:42:23
@blaggacao:matrix.orgDavid 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@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

Show newer messages


Back to Room ListRoom Version: 6