snowfallorg/nixos-conf-editor

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"

Opened this issue · 6 comments

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

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

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

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)

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";

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

if so, the readme should probably be updated accordingly