mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 00:48:58 +02:00
flake: export raw modules
This commit is contained in:
parent
a6eec507cc
commit
ffe3b6d3d8
1 changed files with 156 additions and 147 deletions
57
flake.nix
57
flake.nix
|
@ -10,12 +10,12 @@
|
|||
inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
pre-commit-hooks,
|
||||
...
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, flake-utils
|
||||
, pre-commit-hooks
|
||||
, ...
|
||||
} @ inputs:
|
||||
with nixpkgs.lib;
|
||||
with builtins; let
|
||||
|
@ -43,11 +43,13 @@
|
|||
|
||||
flakeOutput =
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system: let
|
||||
(system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
extractRustAnalyzer = {
|
||||
stdenv,
|
||||
pkgs,
|
||||
extractRustAnalyzer =
|
||||
{ stdenv
|
||||
, pkgs
|
||||
,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "extract_rust_analyzer";
|
||||
|
@ -65,7 +67,8 @@
|
|||
'';
|
||||
};
|
||||
extractRustAnalyzerPkg = pkgs.callPackage extractRustAnalyzer { };
|
||||
in {
|
||||
in
|
||||
{
|
||||
checks =
|
||||
(import ./tests {
|
||||
inherit pkgs;
|
||||
|
@ -97,9 +100,9 @@
|
|||
};
|
||||
runUpdates =
|
||||
pkgs.callPackage
|
||||
({
|
||||
pkgs,
|
||||
stdenv,
|
||||
({ pkgs
|
||||
, stdenv
|
||||
,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "run-updates";
|
||||
|
@ -132,15 +135,16 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
formatter = let
|
||||
formatter =
|
||||
let
|
||||
# We need to exclude the plugins/_sources/* files as they are autogenerated
|
||||
# nix formatter only takes a derivation so we need to make a proxy that passes
|
||||
# the correct flags
|
||||
excludeWrapper = {
|
||||
stdenv,
|
||||
alejandra,
|
||||
writeShellScript,
|
||||
...
|
||||
excludeWrapper =
|
||||
{ stdenv
|
||||
, alejandra
|
||||
, writeShellScript
|
||||
, ...
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "alejandra-excludes";
|
||||
|
@ -148,11 +152,13 @@
|
|||
|
||||
dontUnpack = true;
|
||||
dontBuild = true;
|
||||
installPhase = let
|
||||
installPhase =
|
||||
let
|
||||
script = writeShellScript "alejandra-excludes.sh" ''
|
||||
${alejandra}/bin/alejandra --exclude ./plugins/_sources "$@"
|
||||
'';
|
||||
in ''
|
||||
in
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
cp ${script} $out/bin/alejandra-excludes
|
||||
'';
|
||||
|
@ -171,13 +177,16 @@
|
|||
nixosModules.nixvim = import ./wrappers/nixos.nix modules;
|
||||
homeManagerModules.nixvim = import ./wrappers/hm.nix modules;
|
||||
nixDarwinModules.nixvim = import ./wrappers/darwin.nix modules;
|
||||
rawModules.nixvim = modules;
|
||||
|
||||
templates = let
|
||||
templates =
|
||||
let
|
||||
simple = {
|
||||
path = ./templates/simple;
|
||||
description = "A simple nix flake template for getting started with nixvim";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
default = simple;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue