Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install the package with following error when trying to build Nix: "error: attempt to call something which is not a function but a set" #18

Open
DavideCannonito opened this issue Dec 15, 2023 · 6 comments

Comments

@DavideCannonito
Copy link

DavideCannonito commented Dec 15, 2023

I just started using NixOS, sorry if I did something wrong.

Hello, I saw your package from https://github.com/nix-community/awesome-nix and I wanted to give it a shot.
I also tried to install your package "nix-software-center" which builds correctly and works, but for some reason this doesn't.
My configuration is split between files, to have a better management, and its as follows:
sudo ls /etc/nixos/ configuration.nix font_awesome.nix hardware-configuration.nix nix-software-center.nix plymouth.nix sway_programs.nix disk_mounts.nix gnome.nix nixos-conf-editor.nix pipewire.nix sway.nix vscode_unstable.nix

the nixos-conf-editor.nix is included in configuration.nix and its content is as follows:

` # nixos-conf-editor.nix
{ config, pkgs, lib, ... }:

let
	nixos-conf-editor = import (pkgs.fetchFromGitHub {
		owner = "vlinkz";
		repo = "nixos-conf-editor";
		rev = "0.1.2";
		sha256 = "sha256-/ktLbmF1pU3vFHeGooDYswJipNE2YINm0WpF9Wd1gw8=";
	}) {};
in
{
	environment.systemPackages = with pkgs; [
	nixos-conf-editor
	];
}

`

This is what it shows when I try to run sudo nixos-rebuild switch (and also with sudo nixos-rebuild switch --upgrade):
` [user@NixOS-Top:~]$ sudo nixos-rebuild switch
building Nix...
building the system configuration...
error:
… while calling the 'head' builtin

     at /nix/store/skzb00cq9vb43ryyr8dyzxlqmqmfy0ss-nixos-23.11/nixos/lib/attrsets.nix:922:11:

      921|         || pred here (elemAt values 1) (head values) then
      922|           head values
         |           ^
      923|         else

   … while evaluating the attribute 'value'

     at /nix/store/skzb00cq9vb43ryyr8dyzxlqmqmfy0ss-nixos-23.11/nixos/lib/modules.nix:807:9:

      806|     in warnDeprecation opt //
      807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
         |         ^
      808|         inherit (res.defsFinal') highestPrio;

   (stack trace truncated; use '--show-trace' to show the full trace)

   error: attempt to call something which is not a function but a set

   at /etc/nixos/nixos-conf-editor.nix:4:25:

        3|     let
        4|              nixos-conf-editor = import (pkgs.fetchFromGitHub {
         |                         ^
        5|              owner = "vlinkz";

[user@NixOS-Top:~]$ `

Is there something wrong on my end? TIA

@olifloof
Copy link

I believe at present the config editor only supports a monolithic configuration.nix. This may change in the future.

@DavideCannonito
Copy link
Author

DavideCannonito commented Dec 16, 2023

It still gives the same issue when I put it in configuration.nix, is there something I could provide for troubleshooting this?

@olifloof
Copy link

olifloof commented Dec 16, 2023

not sure then, i don't really have all that much experience with nix myself (even though i've been using it for over a year)

@Sikeen
Copy link

Sikeen commented Mar 7, 2024

it seems i have the same problem. i just installed nixos, so it should be a clean build, but it is also possible i fucked something up during configuration.

                         sudo nixos-rebuild switch:
building Nix...
building the system configuration...
copying path '/nix/store/sdwrgzn5rpzkyssapvmp9wzsaimm40jh-glibc-locales-2.38-44' from 'https://cache.nixos.org'...
copying path '/nix/store/cs5s05avkkn6yx60s93fby6k94mga532-unzip-6.0' from 'https://cache.nixos.org'...
building '/nix/store/fb03dlb5fmzi0j4kc6kpmiimxiw5kr2k-source.drv'...

trying https://github.com/snowfallorg/nixos-conf-editor/archive/0.1.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  684k    0  684k    0     0   951k      0 --:--:-- --:--:-- --:--:-- 3108k
unpacking source archive /build/0.1.2.tar.gz
error:
       … while calling the 'head' builtin

         at /nix/store/flz18yzx8z99pmjb9ifxbhl6421453x3-nixos-23.11/nixos/lib/attrsets.nix:922:11:

          921|         || pred here (elemAt values 1) (head values) then
          922|           head values
             |           ^
          923|         else

       … while evaluating the attribute 'value'

         at /nix/store/flz18yzx8z99pmjb9ifxbhl6421453x3-nixos-23.11/nixos/lib/modules.nix:807:9:

          806|     in warnDeprecation opt //
          807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          808|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attempt to call something which is not a function but a set

       at /etc/nixos/configuration.nix:7:23:

            6| let
            7|   nixos-conf-editor = import (pkgs.fetchFromGitHub {
             |                       ^
            8|     owner = "snowfallorg";

@olifloof
Copy link

olifloof commented Mar 7, 2024

i could hazard a guess that it no longer works when trying to install it without flakes

@olifloof
Copy link

olifloof commented Mar 7, 2024

if so, the readme should probably be updated accordingly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants