Giter VIP home page Giter VIP logo

code2nix's Introduction

code2nix

A simple python script which downloads the latest versions of your currently installed vscode extensions and retrieves their metadata for declarative extensions via extensionsFromVscodeMarketplace.

Some future implementation details include:

  • auto-updating produced expression
  • removing the json middleman (python -> nix)
  • parallelization (speeding up processing and downloads)
  • version checking for compatibility
  • reducing memory and network i/o requirements

How to use?

The syntax for the command follows main.py N {latest,current}.

  • N (default nproc): no. of concurrent extension downloads at a time
  • {latest,current} (default "current"): whether to consider the currently installed version of an extension or simply pull from latest

Note

Due to unfixable issues on my end, please note that trying to pull the latest versions will almost always be 2x longer. This is due to the fact that I have to download the vsix packages twice in order to guarantee consistency. See the "rewrite" branch for more details.

$ python src/main.py $(nproc) latest > latest.nix # the latest versions of your extensions
$ python src/main.py $(nproc) current > current.nix # the current versions of your extensions

Import the file created from the above commands into your configurations.

NixOS Configuration
# configuration.nix
{ config, lib, pkgs, ... }: {
    environment.systemPackages = with pkgs; [
        (vscode-with-extensions.override {
           vscodeExtensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace (import ./ext.nix);
        })
    ];
}
        
Home Manager Configuration
# home.nix
{ config, lib, pkgs, ... }: {
    programs.vscode.enable = true;
    programs.vscode.extensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace (import ./ext.nix);
}
        

License

All code in this project is licensed under the GNU GPL v3 license. Extensions remained licensed under their original license and any other licenses that pertain to them (this license excluded).

code2nix's People

Contributors

frontear avatar

Watchers

 avatar

code2nix's Issues

Improve Parallelization

Currently the app is getting stuck yuce.erlang-otp as its final, despite the fact that the file is NOT big at all. I'm not entirely sure why its getting stuck. This is a problematic thing.

Also I'm not a massive fan of this threading thing. First thing is I'm not even sure if its the most effective parallelization that I could be doing, and secondly is that I want it to flow in based on whichever one finishes first, like a Queue of sorts. The if not task.done() thing is not the most ideal solution here.

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.