nix-community / gomod2nix

Convert applications using Go modules to Nix expressions [maintainer=@marcusramberg]
MIT License
235 stars 56 forks source link

error: value is null while a list was expected in parser.nix:158 #111

Open delneg opened 1 year ago

delneg commented 1 year ago
error: value is null while a list was expected

       at /nix/store/y6p51jza33989fck64faj0wyk2b1cp15-source/builder/parser.nix:158:22:

          157|             } else {
          158|               path = elemAt m2 0;
             |                      ^
          159|             })

The contents of build file:

{ pkgs ? (
    let
      inherit (builtins) fetchTree fromJSON readFile;
      inherit ((fromJSON (readFile ./flake.lock)).nodes) nixpkgs gomod2nix;
    in
    import (fetchTree nixpkgs.locked) {
      overlays = [
        (import "${fetchTree gomod2nix.locked}/overlay.nix")
      ];
    }
  )
}:

pkgs.buildGoApplication {
  pname = "pkg";
  version = "0.1";
  pwd = builtins.path { path = ./..; };
  src = builtins.path { path = ../pkg; };
  modules = ../gomod2nix.toml;
}
delneg commented 1 year ago

Turns out, it's because of comments in the "replace" directive.