mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
templates: switch to flake-parts
This commit is contained in:
parent
31284ddabe
commit
f16f767f46
2 changed files with 44 additions and 29 deletions
|
@ -3,8 +3,11 @@
|
|||
nixvim.url = "path:../../..";
|
||||
simple = {
|
||||
url = "path:../../simple";
|
||||
inputs.nixvim.follows = "nixvim";
|
||||
inputs.flake-utils.follows = "nixvim/flake-utils";
|
||||
inputs = {
|
||||
nixvim.follows = "nixvim";
|
||||
nixpkgs.follows = "nixvim/nixpkgs";
|
||||
flake-parts.follows = "nixvim/flake-parts";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -2,43 +2,55 @@
|
|||
description = "A nixvim configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixvim.url = "github:nix-community/nixvim";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixvim,
|
||||
flake-utils,
|
||||
flake-parts,
|
||||
...
|
||||
} @ inputs: let
|
||||
config = import ./config; # import the module directly
|
||||
in
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nvim = nixvim'.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
module = config;
|
||||
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||
extraSpecialArgs = {
|
||||
inherit self;
|
||||
};
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
# Run `nix flake check .` to verify that your config is not broken
|
||||
default = nixvimLib.check.mkTestDerivationFromNvim {
|
||||
inherit nvim;
|
||||
name = "A nixvim configuration";
|
||||
};
|
||||
};
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
packages = {
|
||||
# Lets you run `nix run .` to start nixvim
|
||||
default = nvim;
|
||||
perSystem = {
|
||||
pkgs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
nixvimLib = nixvim.lib.${system};
|
||||
nixvim' = nixvim.legacyPackages.${system};
|
||||
nvim = nixvim'.makeNixvimWithModule {
|
||||
inherit pkgs;
|
||||
module = config;
|
||||
# You can use `extraSpecialArgs` to pass additional arguments to your module files
|
||||
extraSpecialArgs = {
|
||||
inherit self;
|
||||
};
|
||||
};
|
||||
in {
|
||||
checks = {
|
||||
# Run `nix flake check .` to verify that your config is not broken
|
||||
default = nixvimLib.check.mkTestDerivationFromNvim {
|
||||
inherit nvim;
|
||||
name = "A nixvim configuration";
|
||||
};
|
||||
};
|
||||
|
||||
packages = {
|
||||
# Lets you run `nix run .` to start nixvim
|
||||
default = nvim;
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue