GithubHelp home page GithubHelp logo

flakebi / nixos-vsliveshare Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msteen/nixos-vsliveshare

0.0 2.0 0.0 39 KB

Live Share support in Visual Studio Code for NixOS

License: MIT License

Nix 99.57% C 0.43%

nixos-vsliveshare's Introduction

Live Share support in Visual Studio Code for NixOS

Experimental support for Live Share in VS Code for NixOS. The need to modify the extension directory in a destructive way and most updates causing the patch files to no longer apply, makes it unsuitable for inclusion in the main Nixpkgs repository, so it is kept in its own repository until a better solution is found.

Installation

WARNING: The Live Share extension required .NET Core SDK 3, which is not present within the Nixpkgs channel nixos-19.09, so if you are not on Nixpkgs channel nixos-20.03 or up, it will fail to build with called without required argument 'dotnet-sdk_3'. To workaround this issue, there is the nixpkgs option that allows you to specify the path to the Nixpkgs channel that is to be used to build the extension.

{
  imports = [
    (fetchTarball "https://github.com/msteen/nixos-vsliveshare/tarball/master")
  ];

  services.vsliveshare = {
    enable = true;
    extensionsDir = "$HOME/.vscode-oss/extensions";
    nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/61cc1f0dc07c2f786e0acfd07444548486f4153b";
  };
}

Home Manager

{
  imports = [
    "${fetchTarball "https://github.com/msteen/nixos-vsliveshare/tarball/master"}/modules/vsliveshare/home.nix"
  ];

  services.vsliveshare = {
    enable = true;
    extensionsDir = "$HOME/.vscode-oss/extensions";
    nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/61cc1f0dc07c2f786e0acfd07444548486f4153b";
  };
}

Usage

You can manually run fix-vsliveshare to fix the current extension within ~/.vscode/extensions (i.e. when installed through vscode's extension management). Or you can have this done automatically whenever a new version is installed with systemctl --user enable auto-fix-vsliveshare && systemctl --user start auto-fix-vsliveshare. In both cases you will have to reload the VS Code window to get the fixed Live Share to load. In the case of the auto fixer, note that if you reload too fast (e.g. immediately after the Live Share extension is installed through VS Code's extension manager) then the fix might not have enough time to fully build, so either give it a few seconds or if you were to fast, simply reload the window yet again.

Older versions

There will be an update that causes the current package to fail to build for that version, e.g. due to structural changes made to the extension. In that case please create an issue here and in the meantime you can downgrade the Live Share extension, which will pin the extension that particular version regardless of future updates. Then we can run the fixer by passing it the older version (e.g. fix-vsliveshare 1.0.1653) or the older extension directory name (e.g. fix-vsliveshare ms-vsliveshare.vsliveshare-1.0.1653).

Limitations

  • The package requires SDK 3, which is only available in Nixpkgs channel nixos-20.03 and up.

  • The things that need patching in the extension's source code so far have been almost consistent, but the structure of the package itself has changed over the versions (e.g. extension.js -> extension-prod.js), so these kind of changes might cause the fix to fail in the future.

nixos-vsliveshare's People

Contributors

flakebi avatar msteen avatar phryneas avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.