Error: attribute 'numbers' missing when installing home packages

Since the 22.11 version of Nix I had some trouble with my installation. Every time i want to set it up it returns me an error in picom.nix even when I cut off the part about picom in my home.nix.
Looking in the release information I found out that I needed to take of the bracket in my file in order to get a float and not a string but this came from 22.05 and doesn’t seems to work
Here is the full error :
`error: attribute ‘numbers’ missing

   at /nix/store/4asrgr13kkkjgir8pmapkz7hw13l73z4-source/modules/services/picom.nix:144:14:

      143|     activeOpacity = mkOption {
      144|       type = types.numbers.between 0 1;
         |              ^
      145|       default = 1.0;

`

2 Likes

Can you share more of your setup?

Usually errors like this are a hint for channel/input mismatches.

From your text I infer you are using home-manager.

So once you switch nixpkgs to nix*-unstable you also need to switch home-manager to master.

When you want to switch back one of these back to the stable release, you have to do the other as well.

1 Like

Yes seems that I’m using home-manager and nixos-unstable
My config information :

- system: `"x86_64-linux"`
 - host os: `Linux 5.15.58, NixOS, 22.05 (Quokka), 22.05.20220802.a9f66ae`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.8.1`
 - channels(user): `"nixos-unstable"`
 - nixpkgs: `/nix/store/jq982dblbciscpz0qm4zim867ihab5zv-source`

As there is no system wide nixos channel, and nixpkgs points to the store directly…

Are you using flakes?

If so, how does your flake look like?

I’m not using flake but since one of the computer I’m using his a preinstalled one with already some packages and config it can be the case. But mine also have this issue even that he is just the basic installation of nix without specific configurations.

Then I do not understand what you are doing.

Can you please clarify your setup from the original post?

  • What do you mean by the 22.11 version of “nix”? nix is currently available in version 2.11
  • You say “home.nix” though you are not showing any traces of home manager
  • You say you update “it”, what is “it” and how do you do it? what are the commands involved?
  • You said you had to “take of the bracket”, what bracket? Do you have a diff?
  • As your output didn’t provide any traces of a nixos channel, what are you running there and how do you manage the systems inputs?
  • The machine shows being on 22.05 from August, at the same time the only mentioned channel is labeled “unstable” which would be 22.11pre. How comes?
  • Is your configuration publicly available?
  • In one post you mention “one of the computers” and “his” computer and “mine” computer, lets focus on the one you are having trouble with. Or strictly differ in future posts what happens on “your”, “his” or any other computer.
1 Like
  • When I was talking about the 22.11 version of nix I was talking about the 22.11pre channel my bad
  • Here the part of the home.nix without the bracket on the floats
services.picom = {
          enable = true;
          activeOpacity = 1.0;
          inactiveOpacity = 0.95;
          backend = "glx";
          fade = true;
          fadeDelta = 5;
          opacityRules = [ "100:name *= 'i3lock'"
              "99:fullscreen"
              "80:class_g = 'Alacritty' && focused"
              "80:class_g = 'Alacritty' && !focused"
              "100:class_g = 'Firefox' && focused"
              "100:class_g = 'Firefox' && !focused"
          ];
          shadow = true;
          shadowOpacity = 0.90;
          settings = ''
              xrender-sync-fence = true;
          mark-ovredir-focused = false;
          use-ewmh-active-win = true;
          '';
      };
  • Here is the file I use to add my channel, download and install all my packages :
echo "Creating / updating needed channel and preparing nvim config"                                                                                       
nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable 
nix-channel --update 
   
nix-env -iA nixos-unstable.home-manager
   
mkdir -p ~/.config/nixpkgs
cp ./home.nix ~/.config/nixpkgs/
   
echo "Installing home packages"
home-manager switch
  • My configuration isn’t publicly available

  • I was saying that I’m having exactly the same trouble on two different configuration but with the same home.nix because it seems to be an important information.

I have no clue what you mean by “bracket on the floats”, just that it is not in this example. For me “bracket” means [] which denotes a list, which again doesn’t make sense when talking about floats.

That creates a nixos-unstable channel. But HM requires that there are nixpkgs and home-manager in the nix search path, aka NIX_PATH.

Your nix-info -m from above just has shown a nixpkgs but not a home-manager.

And I actually expect HM to fail with something like <home-manager> not found when not having the home-manager channel/nix path entry. With other words: I do not expect it to get that far it came for you!

Can you therefore please share the output of printenv NIX_PATH and ls all of the unnamed entries?

You should reconsider this, and also switch to manage them using flakes. Makes it easier to help you debugging things, as stuff is reprodicible for us.

Of course I can understand when you do not consider either, as both imply some hurdles that are not always easily solvable.

I’m getting the same error using flakes & home-manager. My flake.nix:

{
  description = "My darwin configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-22.05-darwin";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
    darwin.url = "github:lnl7/nix-darwin/master";
    darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
    home-manager.url = "github:nix-community/home-manager/master";
    home-manager.inputs.nixpkgs.follows = "nixpkgs-unstable";
  };

  outputs = { self, darwin, nixpkgs, home-manager, ... }@inputs:
    let
      system = "aarch64-darwin";
      pkgs = import nixpkgs {
        inherit system;
        config = { allowUnfree = true; };
      };
    in
    {
      homeConfigurations."bohendo" = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;
        modules = [{
          home = {
            username = "bohendo";
            homeDirectory = "/Users/bohendo";
            stateVersion = "22.05";
          };
        }];
      };

      darwinConfigurations = {
        darwin = darwin.lib.darwinSystem {
          inherit system inputs;
          modules = [ ./system/configuration.nix ];
        };
      };
    };
}

Fwiw, my system configuration doesn’t do anything with picom, it just installs git & jq & a few other simple utils. Idk what picom is.

I’m trying to rebuild my system & user packages with:

nix build "./darwin#darwinConfigurations.darwin.system" # flake.nix is in this dir
./result/sw/bin/darwin-rebuild switch --flake "./darwin"
nix run --impure github:nix-community/home-manager -- switch --flake "$darwin"

First two steps run w/out error (but don’t seem to do anything… separate issue tho I think) then the home-manager run throws:

error: attribute 'numbers' missing

       at /nix/store/wklbnx7i6cc9mwgg2h9nnq4a524nciia-source/modules/services/picom.nix:144:14:

          143|     activeOpacity = mkOption {
          144|       type = types.numbers.between 0 1;
             |              ^
          145|       default = 1.0;
(use '--show-trace' to show detailed location information)

I tried to switch back to stable nixpkgs but was getting cryptic error: unrecognised flag '--extra-experimental-features' errors so I switch back to unstable.

nix-info:

  • system: "aarch64-darwin"
  • host os: Darwin 22.1.0, macOS 13.0.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.10.3
  • channels(bohendo): "darwin, nixpkgs"
  • channels(root): "nixpkgs"
  • nixpkgs: /Users/bohendo/.nix-defexpr/channels/nixpkgs

You are using nixpkgs 22.05 and HM from master. This is obviously a mismatch. Please use unstable nixpkgs or stable HM.

2 Likes

Thank you, that’s exactly what I needed ^^
I thought some *-darwin nixpkgs was required on mac & since */unstable-darwin wasn’t available I thought the most recent darwin one was what I wanted… but your answer gave me the courage to try the */unstable channel & it seems to be working smoothly so far, nice!

I got this same issue. I’m not sure if I’m in the same case as the OP in the mismatch nor how to fix it =/

$ nix-info
system: "x86_64-linux", multi-user?: yes, version: nix-env (Nix) 2.8.1, channels(root): "nixos-22.05, nixos-unstable", channels(semar): "nixos-unstable", nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
$ nix-channel --list 
nixos-unstable https://nixos.org/channels/nixos-unstable
$ home-manager --version
22.05
nix-env --version
nix-env (Nix) 2.8.1

The error is exactly the same. Home manager is using pretty much default configs

Can you please show the output of sudo nix-channel --list?

From what is visible in your last post a channel mismatch is likely, but I want to have it confirmed…

Also please run nix-instantiate --eval --expr 'with import <nixos> {}; lib.version' and tell us the output.

sure:

sudo nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/release-22.05.tar.gz
nixos https://nixos.org/channels/nixos-22.05 
nix-instantiate --eval --expr 'with import <nixos> {}; lib.version'
"22.05.4498.5cb48ea3c19"

Since the versions seem to match here is the home.nix file. Its under .config/nixpkgs/home.nix and its the only file there

{ config, pkgs, ... }:

{
  # Home Manager needs a bit of information about you and the
  # paths it should manage.
  home.username = "semar";
  home.homeDirectory = "/home/semar";

  # This value determines the Home Manager release that your
  # configuration is compatible with. This helps avoid breakage
  # when a new Home Manager release introduces backwards
  # incompatible changes.
  #
  # You can update Home Manager without changing this value. See
  # the Home Manager release notes for a list of state version
  # changes in each release.
  home.stateVersion = "22.05";

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}