Problems installing rescript-vscode pakcage


Trying to install the vscode-extensions.chenglou92.rescript-vscode package.

I have a vscode.nix that looks like this that configuration.nix imports:

{ pkgs, ... }:

  extensions = (with pkgs.vscode-extensions; [
  ]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
    name = "groovylambda";
    publisher = "sheaf";
    version = "0.1.0";
    sha256 = "1j2w6y90qwzaima1gg6vb9fij400hxfbxlla1a55hqjls6157zbf";
  vscode-with-extensions = pkgs.vscode-with-extensions.override {
    vscodeExtensions = extensions;
  config = {
    environment.systemPackages = [

When I added the line chenglou92.rescript-vscode and rebuilt, it failed with this message:

building the system configuration...
error: undefined variable 'chenglou92'

       at /nix/store/lwza4577zj3h844fwif9zdzlk0blvbvz-source/vscode.nix:8:5:

            7|     jnoortheen.nix-ide
            8|     chenglou92.rescript-vscode
             |     ^
            9|   ]) ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
(use '--show-trace' to show detailed location information)
error: getting status of '/tmp/nixos-rebuild.YJOGd1/result': No such file or directory

Without it, it is working fine.

My nix-channel is set to 21.11:

❯ nix-channel --list

I’m puzzled since the package seems to be listed in the package registry, are there any reasons it would not find the package?

Have you switched channels recently?

Did you not update them for a while?

Did you run the nix-channel command as user or as root?

Couple of weeks ago I guess.

I would guess I probably ran nix-channel as a user. Do I need to do it as root?

Could also probably mention that I’m using a flake, so I’m updating with sudo nixos-rebuild switch --flake ~/.config/nixpkgs in case that makes any difference.

Ah, Interesting. Seems like my root nix-channel was quite old. Is this one the one connected to the packages installed through configuration.nix?

❯ sudo nix-channel --list

I updated through root by the old nix-channel so it looks like this:

❯ sudo nix-channel --list

And ran

sudo nix-channel --update

and then

sudo nixos-rebuild switch --flake ~/.config/nixpkgs

Also tried this and rebooted:

sudo nixos-rebuild --upgrade boot --flake ~/.config/nixpkgs

But still, it seems to not find that package :thinking: Did I miss a step?

Flakes do not care for your channels, what are the inputs on the flake and how do you generate the system configuration?

1 Like

Ah! Thanks so much for pointing me in that direction!

Set the input in flake.nix like this and rebuilt, and now it works :tada:

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";

This had been an underlying issue for several problems I had as I believed I was already upgraded