volar: add package

This commit is contained in:
Dmitriy Pleshevskiy 2023-04-05 13:42:33 +03:00
parent cfb1f5f211
commit 1846fa41ba
Signed by: pleshevskiy
GPG Key ID: 79C4487B44403985
3 changed files with 49 additions and 5 deletions

View File

@ -71,3 +71,11 @@ _Python dependency checker._
References:
- [https://github.com/tweag/FawltyDeps](https://github.com/tweag/FawltyDeps)
# Volar
_High-performance Vue language tooling based-on Volar.js_
References:
- [https://github.com/vuejs/language-tools](https://github.com/vuejs/language-tools)

View File

@ -30,6 +30,22 @@
"type": "github"
}
},
"nixpkgs_volar": {
"locked": {
"lastModified": 1674717306,
"narHash": "sha256-NSbsdPMKQhd3w3YUo/9vjgG7EGCpAvNKNW+/Ps410Lk=",
"owner": "ehllie",
"repo": "nixpkgs",
"rev": "63026ac84856a3407c359e13b72d8aa0612ebd3e",
"type": "github"
},
"original": {
"owner": "ehllie",
"ref": "volar",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": [
@ -57,6 +73,7 @@
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs_volar": "nixpkgs_volar",
"poetry2nix": "poetry2nix",
"wd2": "wd2"
}

View File

@ -10,13 +10,15 @@
wd2.url = "git+https://git.pleshevski.ru/pleshevskiy/wd2";
wd2.inputs.nixpkgs.follows = "nixpkgs";
wd2.inputs.flake-utils.follows = "flake-utils";
nixpkgs_volar.url = "github:ehllie/nixpkgs/volar";
};
outputs = { nixpkgs, flake-utils, poetry2nix, ... } @ inputs:
let
inherit (builtins) listToAttrs mapAttrs;
allPackageNames = [ "d2" "d2plugin-tala" "d2full" "wd2" "fawltydeps" ];
allPackageNames = [ "d2" "d2plugin-tala" "d2full" "wd2" "fawltydeps" "volar" ];
mkAllPackages = pkgs':
let
d2-unwrapped = pkgs'.callPackage ./pkgs/d2/d2-unwrapped.nix { };
@ -24,15 +26,32 @@
d2 = pkgs'.callPackage ./pkgs/d2 {
inherit d2-unwrapped d2plugin-tala;
};
fawltydeps = pkgs'.callPackage ./pkgs/fawltydeps { };
wd2 = pkgs'.callPackage "${inputs.wd2}/wd2.nix" { inherit d2; };
in
{
inherit d2 d2plugin-tala wd2 fawltydeps;
inherit d2 d2plugin-tala;
d2-full = d2.override { withTala = true; };
wd2 = pkgs'.callPackage "${inputs.wd2}/wd2.nix" { inherit d2; };
fawltydeps = pkgs'.callPackage ./pkgs/fawltydeps { };
# Temporary workaround to use volar language server for vue
#
# Remove when the following PR will be merged
# https://github.com/NixOS/nixpkgs/pull/190921
volar = inputs.nixpkgs_volar.legacyPackages.${pkgs'.system}.nodePackages.volar;
};
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
mkApp = drv:
let
inherit (builtins) head split;
pname = head (split "-" drv.name);
in
flake-utils.lib.mkApp
{
inherit drv;
name = if pname == "volar" then "vue-language-server" else pname;
};
mkOverlay = name:
final: prev:
final.filterAttrs (n: v: n == name) (mkAllPackages prev)