nix-community / nix-vscode-extensions

Nix expressions for VSCode and OpenVSX extensions [maintainers: @deemp, @AmeerTaweel]
MIT License
228 stars 13 forks source link

Attempting to use ziglang extension fails #38

Closed buzmeg closed 1 year ago

buzmeg commented 1 year ago

If I do "nix develop --show-trace", attempting to use ziglang results in an error:

I checked using the method documented and it appears to exist:

nix-repl> t.open-vsx.zig<tab>
t.open-vsx.ziglang  t.open-vsx.zignd

However, it fails with :

error:
       … while calling the 'derivationStrict' builtin

         at //builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'nix-shell'
         whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'buildInputs' of derivation 'nix-shell'

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:350:7:

          349|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          350|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          351|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       … while evaluating derivation 'vscodium-with-extensions-1.78.2.23132'
         whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'buildCommand' of derivation 'vscodium-with-extensions-1.78.2.23132'

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:87:14:

           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

       … while evaluating derivation 'vscode-extensions'
         whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'passAsFile' of derivation 'vscode-extensions'

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:88:7:

           87|       inherit buildCommand name;
           88|       passAsFile = [ "buildCommand" ]
             |       ^
           89|         ++ (derivationArgs.passAsFile or []);

       … while evaluating derivation 'vscode-extensions-json'
         whose name attribute is located at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/stdenv/generic/make-derivation.nix:303:7

       … while evaluating attribute 'text' of derivation 'vscode-extensions-json'

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/build-support/trivial-builders/default.nix:139:16:

          138|     runCommand name
          139|       { inherit text executable checkPhase meta allowSubstitutes preferLocalBuild;
             |                ^
          140|         passAsFile = [ "text" ];

       … from call site

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/with-extensions.nix:52:12:

           51|     destination = "/share/vscode/extensions/extensions.json";
           52|     text = vscode-utils.toExtensionJson vscodeExtensions;
             |            ^
           53|   };

       … while calling 'toExtensionJson'

         at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/extensions/vscode-utils.nix:132:21:

          131|
          132|   toExtensionJson = extensions: builtins.toJSON (map toExtensionJsonEntry extensions);
             |                     ^
          133| in

       error: attribute 'vscodeExtUniqueId' missing

       at /nix/store/ivbddh1g0p4rc85lksflqp2clcpfqfp3-source/pkgs/applications/editors/vscode/extensions/vscode-utils.nix:106:12:

          105|     identifier = {
          106|       id = ext.vscodeExtUniqueId;
             |            ^
          107|       uuid = "";

My flake.nix is basically a copy of the template as follows:

> cat flake.nix
{
  inputs = {
    nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
    flake-utils.follows = "nix-vscode-extensions/flake-utils";
    nixpkgs.follows = "nix-vscode-extensions/nixpkgs";
  };

  outputs = inputs:
    inputs.flake-utils.lib.eachDefaultSystem
      (system:
        let
          pkgs = inputs.nixpkgs.legacyPackages.${system};
          extensions = inputs.nix-vscode-extensions.extensions.${system};
          inherit (pkgs) vscode-with-extensions vscodium;

          packages.default =
            vscode-with-extensions.override {
              vscode = vscodium;
              vscodeExtensions = [
                extensions.vscode-marketplace.golang.go
                extensions.open-vsx.ziglang  # <-- This line causes a failure
                extensions.open-vsx-release.rust-lang.rust-analyzer
              ];
            };

          devShells.default = pkgs.mkShell {
            buildInputs = [ packages.default ];
            shellHook = ''
              printf "VSCodium with extensions:\n"
              codium --list-extensions
            '';
          };
        in
        {
          inherit packages devShells;
        });
}

Thanks.

deemp commented 1 year ago

@buzmeg ziglang is a publisher. Please, see the Note

buzmeg commented 1 year ago

Indeed they are. :man_facepalming:

Sorry about the noise. I don't know if you could make that error message better or not.

I'll close the issue.