这是indexloc提供的服务,不要输入任何密码
Skip to content

GTrunSec/vs-ext

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License NixOS

Notice

This is alpha quality at most. There are still some rough revision to be made, especially since the author have somewhat eligible capacity to pull this off.

In the meantime, check out devos for more interesting use of Nix.

Usage

Within devos itself, you can use as follow:

In flake.nix:

{
  inputs.vs-ext.url = "github:divnix/vs-ext";
  outputs = inputs@{ vs-ext, ... }: digga.lib.mkFlake {
    channels.nixos.overlays = [ vs-ext.overlay ];
  };
};

In pkgs/default.nix:

final: prev:
let
  sources = (import ./_sources/generated.nix) { inherit (final) fetchurl fetchgit; };
  
  mkVscodeExtension = extension:
    final.vscode-utils.mkVscodeExtension extension { };

  newPkgsSet = pkgSet:
    let
      prefix = "${pkgSet}-";

      pkgSetBuilder = {
        "vscode-extensions" = mkVscodeExtension;
      }.${pkgSet};


      pkgsInSources = final.lib.mapAttrs' (name: value: final.lib.nameValuePair (final.lib.removePrefix prefix name) (value)) (final.lib.filterAttrs (n: v: final.lib.hasPrefix prefix n) sources);
    in
    final.lib.mapAttrs (n: v: pkgSetBuilder v) pkgsInSources;
in
{
  inherit sources;

  vscode-extensions = prev.vscode-extensions // (newPkgsSet "vscode-extensions");
}

(wait for this PR to merge as it is the same as the above, just remember that the PR was for vimPlugins, so adjust accordingly).

This gives us auto-generated VS Code extensions with meta attributes. See src/generators.nix for a detailed overview.

Helper scripts a.k.a devshell

You can use bud/vscode-ext-prefetch.bash to generate sources and metadata passthrough for extensions. Note that support for VS Marketplace extensions is not yet available as I could only find APIs for OpenVSX.

And no, there aren't any devshell yet. See below for details.

Shoulders

This work does not reinvent the wheel. It stands on the shoulders of the following giants:

🧅 — like the layers of an onion

👪 — like family

❤️

Things that would really improve the quality of this work

  • devshell (obviously, but bud is still experimental, so documentations seem vague, or maybe I just got lazy).
  • More intuitive arrangement of src. This is a mess I created from lib and vscode-utils, so I really hope to separate them appropriately.
  • Maybe a template or at least a guideline for creating projects like this in the future? This whole project is already small, but I still can't grasp some of the core concepts. With a little of extra helps, maybe I can really pull this one off for real.

Over time, this will improve, just not right now (I might get overwhelmed as this is my first time ever contributing and managing a repository, but it won't stop me from making progress).

About

A kick ass library to dominate your Visual Studio Extensions (with DevOS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 94.4%
  • Shell 5.6%