codium-test.nix 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
let
  pinnedPkgs = import (/home/timon/rep/config/config-pin.nix);
  desktopUnstablePkgs = pinnedPkgs.desktop-unstable {
    config.pulseaudio = true;
    config.allowUnfree = true;
  };
  pkgs = desktopUnstablePkgs;

  version = "0.8.30";

  helperBinary = pkgs.buildGoPackage rec {
    name = "helperbinary-${version}";
    src = ./.;
    goPackagePath = [ "git.dolansoft.org/timon/soicode" ];
    goDeps = ./helper/deps.nix;
  };

  soicodePlugin = pkgs.vscode-utils.buildVscodeExtension {
    name = "soicode-${version}";
    vscodeExtUniqueId = "swissolyinfo.soicode";
    src = ./.;
    buildInputs = [ pkgs.nodejs pkgs.stdenv pkgs.go ];
    configurePhase = "patchShebangs node_modules";
    buildPhase = ''
      cp ${helperBinary}/bin/helper ./dist/helper-linux-amd64
      npm run build-package
    '';
    meta = with pkgs.stdenv.lib; {
      license = licenses.mit;
      platforms = [ "x86_64-linux" ];
    };

  };

  codiumPlugins = pkgs.buildEnv {
    name = "codium-extensions";
    paths = (pkgs.vscode-utils.extensionsFromVscodeMarketplace [{
      name = "vim";
      publisher = "vscodevim";
      version = "1.12.2";
      sha256 = "1a4r07xijrnz7bxkkpl2njwv2128hcwvmqvmirw4v41paw559231";
    }]) ++ [ pkgs.vscode-extensions.ms-vscode.cpptools ] ++ [ (soicodePlugin) ];
  };
  codiumCommand = (pkgs.writeScriptBin "coTest" ''
    #!${pkgs.stdenv.shell}
    exec ${pkgs.vscodium}/bin/codium --extensions-dir ${codiumPlugins}/share/vscode/extensions $@
  '');

in pkgs.mkShell { buildInputs = [ (codiumCommand) ]; }