Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeium extension is not usable because it wants to download a binary on a read-only system #79

Open
dasj19 opened this issue Sep 8, 2024 · 0 comments

Comments

@dasj19
Copy link

dasj19 commented Sep 8, 2024

Hello, I wanted to get codeium working and I faced issues because the extension expected to be able to download a binary that will den run.

What I tried, with home-manager:

programs.vscode.extensions = with pkgs.vscode-marketplace; with pkgs.vscode-extensions; [
   codeium.codeium
];

It would be nice if it would work that way, but I then tried a workaround:

programs.vscode.extensions =
  let
      codium-vsix = pkgs.vscode-utils.buildVscodeMarketplaceExtension rec {
        mktplcRef = {
          name = "codeium";
          version = "1.17.1";
          publisher = "Codeium";
        };
        vsix = builtins.fetchurl {
            url = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/Codeium/vsextensions/codeium/1.17.1/vspackage";
            sha256 = "1ds9qcp7q2a84ia78ggwshlnj988sylv8zfh9zvdhbwb77lh93v1";
          };
        language-server = builtins.fetchurl {
          url = "https://github.com/Exafunction/codeium/releases/download/language-server-v1.16.1/language_server_linux_x64";
          sha256 = "0rsrc51p4mccy4xzs4mk6x1a53ay451m7cam95kzpkva7rbk9k8p";
        };
        
        nativeBuildInputs = [ pkgs.unzip ];
        buildInputs = [ pkgs.codeium ];
        unpackPhase = ''
          runHook preUnpack
          
          mkdir -p extension/dist/40c19f24318b082e366fe4260c6c56b2316bb655
          unzip ${vsix}

          # This does not work.
          # cp ${language-server} extension/dist/40c19f24318b082e366fe4260c6c56b2316bb655/language_server_linux_x64
          # chmod +777 extension/dist/40c19f24318b082e366fe4260c6c56b2316bb655/language_server_linux_x64

          ln -s /home/daniel/system/home-manager/codium/language_server_linux_x64 extension/dist/40c19f24318b082e366fe4260c6c56b2316bb655/language_server_linux_x64
          runHook postUnpack
        '';
        installPhase = ''
        '';
      };
  in
    with pkgs.vscode-marketplace; with pkgs.vscode-extensions; [
    codium-vsix
  ];

I would like a more generic solution, without having to keep the language server binary in my home folder unmanaged by nixos or home-manager. Any advice is welcomed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant