Nixos build broken?

 nix eval --show-trace --recreate-lock-file .#nixosConfigurations.nixos.config.system.build.toplevel
warning: updating lock file '/home/paki/src/nixos/flake.lock':
* Updated 'nixpkgs': 'github:NixOs/nixpkgs/e9158eca70ae59e73fae23be5d13d3fa0cfc78b4' -> 'github:NixOS/nixpkgs/e9158eca70ae59e73fae23be5d13d3fa0cfc78b4'
warning: Git tree '/home/paki/src/nixos' is dirty
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: Warning: `showVal` is deprecated and will be removed in the next release, please use `traceSeqN`
trace: `lib.nixpkgsVersion` is deprecated, use `lib.version` instead!
trace: lib.zip is deprecated, use lib.zipAttrsWith instead
trace: warning: lib.readPathsFromFile is deprecated, use a list instead
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'stdenv' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:202:18:
while evaluating the attribute 'all' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:11:7:
while evaluating the attribute 'out' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:17:7:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'initialPath' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/default.nix:118:14:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'stdenv' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:202:18:
while evaluating the attribute 'all' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:11:7:
while evaluating the attribute 'out' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:17:7:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'defaultNativeBuildInputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/default.nix:118:14:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'stdenv' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:202:18:
while evaluating the attribute 'all' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:11:7:
while evaluating the attribute 'out' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:17:7:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'defaultNativeBuildInputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/default.nix:118:14:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'bintools' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/build-support/cc-wrapper/default.nix:114:10:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'bintools_bin' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/build-support/bintools-wrapper/default.nix:82:10:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'nativeBuildInputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:218:11:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'nativeBuildInputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:218:11:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'pkgs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/perl/default.nix:114:7:
while evaluating the attribute 'version' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/top-level/perl-packages.nix:23500:3:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'drvAttrs' at /nix/store/ynh4i5drry7ddycfhsivaar92sl3k5sa-nix-2.4pre20200622_334e26b/share/nix/corepkgs/derivation.nix:12:14:
while evaluating the attribute 'buildInputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:221:11:
while evaluating the attribute 'all' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:149:12:
while evaluating the attribute 'out' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:153:11:
while evaluating the attribute 'pkgs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/perl/default.nix:114:7:
while evaluating the attribute 'OpenGL' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/top-level/perl-packages.nix:15694:3:
while evaluating the attribute 'outPath' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:164:7:
while evaluating the attribute 'buildInputs' of the derivation 'perl5.32.0-OpenGL-0.70' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'propagatedBuildInputs' of the derivation 'glu-9.0.1' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildCommand' of the derivation 'libGL-1.3.2' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildInputs' of the derivation 'libglvnd-1.3.2' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildInputs' of the derivation 'libX11-1.7.0' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/servers/x11/xorg/default.nix:706:5:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'xorgproto-2020.1' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/servers/x11/xorg/default.nix:2682:5:
while evaluating the attribute 'out.outPath' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:156:13:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'meson-0.56.0' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/python/mk-python-derivation.nix:111:5:
while evaluating 'chooseDevOutputs' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/attrsets.nix:475:22, called from undefined position:
while evaluating 'optionals' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/lists.nix:270:5, called from /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/python/mk-python-derivation.nix:122:10:
while evaluating 'hasSuffix' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/strings.nix:234:5, called from /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/python/mk-python-derivation.nix:122:25:
while evaluating the attribute 'src.name' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/tools/build-managers/meson/default.nix:13:3:
while evaluating 'makeOverridable' at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:67:24, called from /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/tools/build-managers/meson/default.nix:13:9:
while evaluating anonymous function at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/python/fetchpypi.nix:23:21, called from /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/lib/customisation.nix:69:16:

error: --- TypeError ----------------------------------------------------------------------- nix
in file: /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/development/interpreters/python/fetchpypi.nix (26:6)

anonymous function at /nix/store/cig3zz9li4b3cv2pvh7f32glb2h7l4c2-source/pkgs/build-support/fetchurl/boot.nix:5:1 called with unexpected argument 'hash'

I’ve gotten this same error even with comenting away every file in my configuration,one at a time.

What are you executing? Can you share your config? It looks like you’re using flakes too, can you confirm that?

Yes,I am using flakes to manage my config.


{
  inputs.nixpkgs={
    url="github:NixOS/nixpkgs/nixos-unstable";
  };
  # inputs.nur.url = github:nix-community/NUR;
  # inputs.nix.inputs.nixpkgs.follows="nixpkgs";
  inputs.home={
#    flake=false;
    inputs.nixpkgs.follows="nixpkgs";
    url="github:nix-community/home-manager";
  };
  # inputs.src={
  #   type="tarball";
  #   flake=false;
  #   url="https://update.code.visualstudio.com/latest/linux-x64/insider";
  # };
  description = "A flake for building Hello World";

  outputs = { self, nixpkgs , home}@inputs : let
    pkgs=import nixpkgs{
      system="x86_64-linux";
      
      config.allowUnfree = true; 
      inherit(self)overlays;
      config.firefox = {
        enablePlasmaBrowserIntegration = true;
        # enableAdobeFlash=true;
      };
    };
  in {
    overlay=final: prev:{
      tesseract = prev.tesseract4;
      # nixFlakes=prev.nix;
      kwin=prev.kwin.override(old:{
        patches=old.patches++[(
          final.fetchpatch{
            hash="sha256-bS0pDA6TJC+PHTMeeWs2jCZz24mL69PVKPhF897U66M=";
            url="https://tildearrow.zapto.org/storage/kwin-lowlatency/kwin-lowlatency-5.17.0.patch";
          }
        )];
      });
      linux_testing_bcachefs=with final;callPackage ./dev/kernel.nix {
        kernelPatches =
          [ kernelPatches.bridge_stp_helper
            kernelPatches.request_key_helper
          ];
      };
      vaapiIntel = prev.vaapiIntel.override { enableHybridCodec = true; };

      # vscode-insiders= #(final.vscode.override { isInsiders = true;executableName="code"; }).overrideAttrs
      #   (final.callPackage "${nixpkgs}/pkgs/applications/editors/vscode/generic.nix"
      #   (rec {
      #     inherit src;
      #     pname="vscode-insiders";
      #     executableName="code-insiders";
      #     longName="Visual Studio Code - Insiders";
      #     shortName="Code - Insiders";
      #     sourceRoot="";
      #     version = "latest";
      #     #plat = "linux-x64";Build problem
      #     #archive_fmt = "tar.gz";
      #     meta={};
      #   })).overrideAttrs(old:{
        
      #     #backport "https://github.com/NixOS/nixpkgs/pull/79889/files"
      #     preFixup = with final; ''
      #       gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${
      #         lib.makeLibraryPath [ systemd fontconfig libdbusmenu-gtk3 ]
      #       })
      #     '';
      # });
    };
    overlays=[
      # nix.overlay
      self.overlay
    ];
    packages.x86_64-linux=pkgs;
    nixosConfigurations.nixos=nixpkgs.lib.nixosSystem ({
      system="x86_64-linux";
      modules=[
#        dwarffs.nixosModules.dwarffs
        home.nixosModules.home-manager
        "${nixpkgs}/nixos/modules/profiles/graphical.nix"
        "${nixpkgs}/nixos/modules/installer/scan/not-detected.nix"
        "${nixpkgs}/pkgs/misc/cups/drivers/samsung/1.00.36/module.nix"
        ./core.nix
        {
          nixpkgs={
            inherit(self)overlays;
          };
          nix.nixPath=[
            "nixpkgs=${nixpkgs}"
            "nixos-config=${./configuration.nix }"
            "home-manager=${home}"
          ];
        }
      ];
      specialArgs={
        inherit inputs;
      };
    });

  };
}

However the error does not seem to be dependent on the config, as I’ve commented every line of imports in ./core.nix and the error message remained the same.

I get the same error for my config as well on eval, though building works fine. Are you sure that eval is what you wanted to do?

1 Like

If you are trying to evaluate the derivation to get the path, use ...toplevel.outPath or ...toplevel.drvPath or add the option --raw (depending on what you want)

I think the reason is that nix eval trys to deeply evaluate the entire thing, but since Nix is lazily evaluated it contains loops and (benign) errors. It can be confusing though