mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
flake: Move helper derivations in a separate directory (#544)
This commit is contained in:
parent
fd88522893
commit
09cefd2751
4 changed files with 62 additions and 48 deletions
49
flake.nix
49
flake.nix
|
@ -57,26 +57,6 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
extractRustAnalyzer = {
|
|
||||||
stdenv,
|
|
||||||
pkgs,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "extract_rust_analyzer";
|
|
||||||
version = "master";
|
|
||||||
|
|
||||||
dontUnpack = true;
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
buildInputs = [pkgs.python3];
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
ls -la
|
|
||||||
mkdir -p $out/bin
|
|
||||||
cp ${./helpers/extract_rust_analyzer.py} $out/bin/extract_rust_analyzer.py
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
extractRustAnalyzerPkg = pkgs.callPackage extractRustAnalyzer {};
|
|
||||||
in {
|
in {
|
||||||
checks =
|
checks =
|
||||||
(import ./tests {
|
(import ./tests {
|
||||||
|
@ -116,34 +96,13 @@
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
packages = {
|
packages =
|
||||||
|
{
|
||||||
docs = pkgs-unfree.callPackage (import ./docs) {
|
docs = pkgs-unfree.callPackage (import ./docs) {
|
||||||
modules = nixvimModules;
|
modules = nixvimModules;
|
||||||
};
|
};
|
||||||
runUpdates =
|
}
|
||||||
pkgs.callPackage
|
// (import ./helpers pkgs);
|
||||||
({
|
|
||||||
pkgs,
|
|
||||||
stdenv,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "run-updates";
|
|
||||||
inherit (pkgs.rust-analyzer) version src;
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [extractRustAnalyzerPkg alejandra];
|
|
||||||
|
|
||||||
buildPhase = ''
|
|
||||||
extract_rust_analyzer.py editors/code/package.json |
|
|
||||||
alejandra --quiet > rust-analyzer-config.nix
|
|
||||||
'';
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share
|
|
||||||
cp rust-analyzer-config.nix $out/share
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
{};
|
|
||||||
};
|
|
||||||
legacyPackages = rec {
|
legacyPackages = rec {
|
||||||
makeNixvimWithModule = import ./wrappers/standalone.nix pkgs modules;
|
makeNixvimWithModule = import ./wrappers/standalone.nix pkgs modules;
|
||||||
makeNixvim = configuration:
|
makeNixvim = configuration:
|
||||||
|
|
16
helpers/default.nix
Normal file
16
helpers/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
pkgs: rec {
|
||||||
|
rust-analyzer-config = pkgs.callPackage ./rust-analyzer {};
|
||||||
|
autogenerated-configs = pkgs.callPackage ({stdenv}:
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "autogenerated-configs";
|
||||||
|
version = "master";
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp ${rust-analyzer-config}/share/* $out
|
||||||
|
'';
|
||||||
|
}) {};
|
||||||
|
}
|
39
helpers/rust-analyzer/default.nix
Normal file
39
helpers/rust-analyzer/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
{
|
||||||
|
stdenv,
|
||||||
|
python3,
|
||||||
|
rust-analyzer,
|
||||||
|
alejandra,
|
||||||
|
}: let
|
||||||
|
extract = stdenv.mkDerivation {
|
||||||
|
pname = "extract_rust_analyzer";
|
||||||
|
version = "1";
|
||||||
|
|
||||||
|
src = ./extract.py;
|
||||||
|
|
||||||
|
dontUnpack = true;
|
||||||
|
dontBuild = true;
|
||||||
|
|
||||||
|
buildInputs = [python3];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp $src $out/bin/extract_rust_analyzer.py
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "rust-analyzer-config";
|
||||||
|
inherit (rust-analyzer) version src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [alejandra extract];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
extract_rust_analyzer.py editors/code/package.json |
|
||||||
|
alejandra --quiet > rust-analyzer-config.nix
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share
|
||||||
|
cp rust-analyzer-config.nix $out/share
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue