Completly lost with errors rror: attribute 'extend' missing at /nix/store/b7

its 3 am ive been up all night trying to fix this. Ieven tried reinsalling nix and that didnt work. I found a few posts that seemed like my issue but their fix did nothing for me. here is a link to my config, I have to get to sleep ill post more in the morning. if anyone can lend a hand it would be great, thanks for now # Master configuration file{ config, pkgs, ... }:let # Define user in ./u - Pastebin.com


[nix-shell:~/sysconf]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error: attribute 'extend' missing

       at /nix/store/b7dsb1k7j2prpmn9kz1j48aqn00pnmd7-source/modules/lib/stdlib-extended.nix:7:4:

            6| let mkHmLib = import ./.;
            7| in nixpkgsLib.extend (self: super: {
             |    ^
            8|   hm = mkHmLib { lib = self; };
       Did you mean extends?
(use '--show-trace' to show detailed location information)

It’s going to be in one of your imports or overlays, which you’re currently omitting. I suspect you misunderstood overlays :slight_smile:

Share your other files when you’ve had some rest, shouldn’t be too hard to fix.

Honestly I never heard the word overlays I’ve looked up so many guides and videos and they all seem to do it differently. I’m getting a hang of it but this is day 3 with bix so still much to learn when I get home from work I’ll post files what files do you want to see?

The error seems to imply that you’re using home-manager, but your shared config doesn’t have any mention of that. In any case, the error says that lib.extend doesn’t exist, which is odd, because that was introduced (by yours truly) about 5 years ago!

Could you show the result from running nix-shell -p nix-info --run "nix-info -m"? That should give some more info. And also let us know how you’re using home-manager :slight_smile:

1 Like

yes i attempted to get home manager going but i ran into an error and then all this started.however things were acting odd for the las day or so. Below is the output you requested. So you are the one who created the thing that is causing me trouble? Its ok i still lova ya for helping lol


[llama@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"?
nix-info - get high level info to help with debugging

Options:

 -m, --markdown   formatting for a GitHub issue
                  implies: --host-os, --sandbox

     --sandbox    include sandbox configuration
     --host-os    include host OS details

 -h, --help       show this message
 -d, --debug      debug mode

wait i just realised that is prob not what you wanted. let me try the code again

here ya go
[llama@nixos:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.110, NixOS, 22.11 (Raccoon), 22.11.4091.a08e061a4ee`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(root): `"nixos-22.11"`
 - channels(llama): `"home-manager, unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Nah, it’s more of a “it looks like you’re 5 years out of date, I wrote the thing that’s somehow missing for you now, how on earth did you manage to lose it?”.

Yet your nix-info output doesn’t seem to be 5 years out of date. Yours is barely a week old: Merge pull request #230784 from NixOS/backport-230717-to-release-22.11 · NixOS/nixpkgs@a08e061 · GitHub

I still think the problem is somewhere in the files you try to import, no way to help if we can’t see them. Could you share what’s in all of these imported files:

  user = import ./user/username.nix;
in
{
  imports = [ 
    # User specific options
    ./user/${user}.nix
 
    # Hardware specific configuration
    # ./system/workstation/gnome.nix
    ./system/workstation/hyprland.nix
    # ./system/laptop/configuration.nix # WIP
    # ./system/server/configuration.nix # WIP
  ];
 
  nixpkgs.overlays = [
    (import ./overlays/discord.nix)
    (import ./overlays/electron.nix)
    (import ./overlays/waybar.nix)
  ];

Also as @Infinisil says, we need to know how you were trying to use home-manager, not just that you’ve done something that broke your configuration in ways that seem inconsistent with the linear passage of time :wink:

My guess is you added it in ./user/${user}.nix? Coupled perhaps with a five year old home-manager commit grabbed with fetchurl or such?

Nevermind, figured I’d see where that code was coming from, and stumbled across others with the same issue. Looks like it’s some recent incompatibility between home-manager unstable and nixpkgs stable: Nixos-rebuild fails with current configuration - #7 by klt

Just switch to home-manager’s stable branch, I guess? They are supposed to always match (i.e. use stable on both, or unstable on both, but never a mix), but it won’t always result in problems if they don’t.

ya know I followed so many guides trying to learn nix in the past few days im sure one was a really old guide. and in desperate hail marry to get it working i prob pasted in a config or some code thats old. Here is my goal . I want to install hyprland . thats really it. Also from what I can tell using home manager is what you do . so I figured I should start learning it also. I maybe got ahead of myself

ah ok so because hyprland needs to be unstable ill run both unstable. oh ok i see. change the code then it will let me rebuild

Have you seen the hyprland wiki instructions? They’re pretty good for documentation in the nixosphere: Nix | Hyprland Wiki

Basically put this in your system configuration, and then this in your home-manager configuration.

You shouldn’t need any overlays for any of that.


And - while using unstable is probably fine, and maybe a bit less complex - as a note from someone using hyprland on stable:

It doesn’t necessarily require setting nixpkgs to unstable, since the hyprland wiki config uses flake-compat which should resolve the nixpkgs version as the hyprland flake configured it.

I.e., it uses nixpkgs unstable just to build hyprland, after which the package itself should in theory work anywhere.

The main caveat is that you could run into a similar problem as with nixpkgs/home-manager, that occasionally there might be some drift underneath the hyprland module that ultimately causes it to break, but it’s very unlikely given how small the module is.

If it did happen and the hyprland guys didn’t fix it by themselves, I would also personally petition them to change their module to support both, since I use hyprland on stable and I think it’s a very valid use case :wink:

hey again i really appreciate your assistance. so I started with the hyprland wiki, then i got to home manager and say the big warning about home manager and took a few steps back to learn nixos. move forward 24 hours I start to try to figure out home manager. this lead me down a few paths that ended in errors, i got frustrated… and found one github project that basically would just import everything to your system and ya, not the best move however not the worst.
Just ended up in the situation im on now. so what i think ill do . after reading your advice. im going to delete everything all the overlays from the import stuff all of it. and start with a default config and go down the wiki. however I still dont know how to install home manager but im sure ill figure it out

These are probably the instructions you’ll want to follow: https://nix-community.github.io/home-manager/index.html#sec-install-nixos-module

Note that, where the docs tell you to do this:

home-manager.users.eve = { pkgs, ... }: {
  home.packages = [ pkgs.atool pkgs.httpie ];
  programs.bash.enable = true;
};

You can also replace this bit:

{ pkgs, ... }: {
  home.packages = [ pkgs.atool pkgs.httpie ];
  programs.bash.enable = true;
}

… with e.g. import ./users/${user}.nix. import literally means “take whatever is in this other file and put it here”. I would recommend doing so to clearly distinguish your home-manager configuration from your system configuration.

Once you have that set up it should be fairly easy to get the rest running.

An important thing I want to point out is that you’re using channels now, so be aware of the fact that your root user and your normal user have a different set of channels. So running sudo nix and nix as your user will often install vastly different things. You also need to explicitly update both independently.

Using the NixOS module instead of the standalone installation makes home-manager use your root user’s channels, so this makes it less easy to mix up your channels, but be aware you need to run your commands with sudo to update your home-manager env.

ok thanks, ill try that as i just keep ending up at a dead end with errors, mostly path issues ill give that guide a try

i did just run into this , i found out that running sudo channel list shows different things than just running channel list

Or vice versa I’m pretty sure; home-manager stable with nixpkgs unstable.

I have absolutely no clue what the incompatibility is or why this is the error message you get, but I’ve definitely seen several people experience this super confusing problem. Absolutely bizarre to me.

1 Like

If you still can’t figure it out after bashing your head against the home-manager docs, this is the kind of thing that probably really benefits from a more synchronous form of communication. I’m clearly in an awkward time zone for you, but folks on the matrix channel might be able to help out too.