mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
flake.nix: refactoring using flake-parts
This commit is contained in:
parent
1f1065df1e
commit
31284ddabe
13 changed files with 320 additions and 202 deletions
35
README.md
35
README.md
|
@ -141,27 +141,38 @@ can use the following:
|
||||||
description = "A very basic flake";
|
description = "A very basic flake";
|
||||||
|
|
||||||
inputs.nixvim.url = "github:nix-community/nixvim";
|
inputs.nixvim.url = "github:nix-community/nixvim";
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
|
||||||
nixvim,
|
nixvim,
|
||||||
flake-utils,
|
flake-parts,
|
||||||
}: let
|
} @ inputs: let
|
||||||
config = {
|
config = {
|
||||||
colorschemes.gruvbox.enable = true;
|
colorschemes.gruvbox.enable = true;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
flake-utils.lib.eachDefaultSystem (system: let
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
nixvim' = nixvim.legacyPackages."${system}";
|
systems = [
|
||||||
nvim = nixvim'.makeNixvim config;
|
"aarch64-darwin"
|
||||||
in {
|
"aarch64-linux"
|
||||||
packages = {
|
"x86_64-darwin"
|
||||||
inherit nvim;
|
"x86_64-linux"
|
||||||
default = nvim;
|
];
|
||||||
|
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
nixvim' = nixvim.legacyPackages."${system}";
|
||||||
|
nvim = nixvim'.makeNixvim config;
|
||||||
|
in {
|
||||||
|
packages = {
|
||||||
|
inherit nvim;
|
||||||
|
default = nvim;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
31
flake-modules/checks.nix
Normal file
31
flake-modules/checks.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
makeNixvimWithModuleUnfree,
|
||||||
|
makeNixvimWithModule,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
checks = {
|
||||||
|
tests = import ../tests {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
makeNixvim = configuration:
|
||||||
|
makeNixvimWithModuleUnfree {
|
||||||
|
module = {
|
||||||
|
config = configuration;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extra-args-tests = import ../tests/extra-args.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit makeNixvimWithModule;
|
||||||
|
};
|
||||||
|
|
||||||
|
lib-tests = import ../tests/lib-tests.nix {
|
||||||
|
inherit pkgs;
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
26
flake-modules/default.nix
Normal file
26
flake-modules/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
./checks.nix
|
||||||
|
./dev.nix
|
||||||
|
./lib.nix
|
||||||
|
./legacy-packages.nix
|
||||||
|
./modules.nix
|
||||||
|
./overlays.nix
|
||||||
|
./packages.nix
|
||||||
|
./templates.nix
|
||||||
|
./wrappers.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
_module.args = {
|
||||||
|
pkgsUnfree = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
29
flake-modules/dev.nix
Normal file
29
flake-modules/dev.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.pre-commit-hooks.flakeModule
|
||||||
|
];
|
||||||
|
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
devShells.default = pkgs.mkShellNoCC {
|
||||||
|
shellHook = config.pre-commit.installationScript;
|
||||||
|
};
|
||||||
|
|
||||||
|
formatter = pkgs.alejandra;
|
||||||
|
|
||||||
|
pre-commit = {
|
||||||
|
settings.hooks = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
statix = {
|
||||||
|
enable = true;
|
||||||
|
excludes = [
|
||||||
|
"plugins/lsp/language-servers/rust-analyzer-config.nix"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
flake-modules/legacy-packages.nix
Normal file
18
flake-modules/legacy-packages.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
makeNixvimWithModule,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
legacyPackages = rec {
|
||||||
|
inherit makeNixvimWithModule;
|
||||||
|
makeNixvim = configuration:
|
||||||
|
makeNixvimWithModule {
|
||||||
|
module = {
|
||||||
|
config = configuration;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
20
flake-modules/lib.nix
Normal file
20
flake-modules/lib.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
withSystem,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
flake.lib = lib.genAttrs config.systems (
|
||||||
|
lib.flip withSystem (
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
import ../lib {
|
||||||
|
inherit pkgs lib;
|
||||||
|
inherit (config.legacyPackages) makeNixvim;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
47
flake-modules/modules.nix
Normal file
47
flake-modules/modules.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
modules,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
_module.args = let
|
||||||
|
nixvimModules = with builtins;
|
||||||
|
map
|
||||||
|
(f: ../modules + "/${f}")
|
||||||
|
(
|
||||||
|
attrNames (readDir ../modules)
|
||||||
|
);
|
||||||
|
in {
|
||||||
|
modules = pkgs: let
|
||||||
|
nixpkgsMaintainersList = pkgs.path + "/nixos/modules/misc/meta.nix";
|
||||||
|
|
||||||
|
nixvimExtraArgsModule = rec {
|
||||||
|
_file = ./flake.nix;
|
||||||
|
key = _file;
|
||||||
|
config = {
|
||||||
|
_module.args = {
|
||||||
|
pkgs = pkgs.lib.mkForce pkgs;
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
helpers = import ../lib/helpers.nix {inherit (pkgs) lib;};
|
||||||
|
# TODO: Not sure why the modules need to access the whole flake inputs...
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
nixvimModules
|
||||||
|
++ [
|
||||||
|
nixpkgsMaintainersList
|
||||||
|
nixvimExtraArgsModule
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
_module.args = {
|
||||||
|
modules = modules pkgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
flake-modules/overlays.nix
Normal file
21
flake-modules/overlays.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.flake-parts.flakeModules.easyOverlay
|
||||||
|
];
|
||||||
|
perSystem = {
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
final,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
overlayAttrs = {
|
||||||
|
nixvim = {
|
||||||
|
inherit
|
||||||
|
(config.legacyPackages)
|
||||||
|
makeNixvim
|
||||||
|
makeNixvimWithModule
|
||||||
|
;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
28
flake-modules/packages.nix
Normal file
28
flake-modules/packages.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
pkgsUnfree,
|
||||||
|
config,
|
||||||
|
modules,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
packages = let
|
||||||
|
docs = {
|
||||||
|
docs = pkgsUnfree.callPackage (import ../docs) {
|
||||||
|
inherit modules;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
man-docs = import ../man-docs {
|
||||||
|
pkgs = pkgsUnfree;
|
||||||
|
inherit modules;
|
||||||
|
};
|
||||||
|
|
||||||
|
# TODO: deprecate (unused)
|
||||||
|
helpers = import ../helpers pkgs;
|
||||||
|
in
|
||||||
|
docs
|
||||||
|
// man-docs
|
||||||
|
// helpers;
|
||||||
|
};
|
||||||
|
}
|
8
flake-modules/templates.nix
Normal file
8
flake-modules/templates.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
flake.templates = {
|
||||||
|
default = {
|
||||||
|
path = ../templates/simple;
|
||||||
|
description = "A simple nix flake template for getting started with nixvim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
35
flake-modules/wrappers.nix
Normal file
35
flake-modules/wrappers.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
modules,
|
||||||
|
self,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
wrapperArgs = {
|
||||||
|
inherit modules;
|
||||||
|
inherit self;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
perSystem = {
|
||||||
|
pkgs,
|
||||||
|
pkgsUnfree,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
_module.args = {
|
||||||
|
makeNixvimWithModule =
|
||||||
|
import ../wrappers/standalone.nix
|
||||||
|
pkgs
|
||||||
|
wrapperArgs;
|
||||||
|
|
||||||
|
makeNixvimWithModuleUnfree =
|
||||||
|
import ../wrappers/standalone.nix
|
||||||
|
pkgsUnfree
|
||||||
|
wrapperArgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
flake = {
|
||||||
|
nixosModules.nixvim = import ./nixos.nix wrapperArgs;
|
||||||
|
homeManagerModules.nixvim = import ./wrappers/hm.nix wrapperArgs;
|
||||||
|
nixDarwinModules.nixvim = import ./wrappers/darwin.nix wrapperArgs;
|
||||||
|
};
|
||||||
|
}
|
63
flake.lock
generated
63
flake.lock
generated
|
@ -16,27 +16,29 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"nixpkgs-lib": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701680307,
|
"lastModified": 1704152458,
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
"narHash": "sha256-DS+dGw7SKygIWf9w4eNBUZsK+4Ug27NwEWmn2tnbycg=",
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
"rev": "88a2cd8166694ba0b6cb374700799cec53aef527",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "numtide",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-parts",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_2"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685518550,
|
"lastModified": 1685518550,
|
||||||
|
@ -89,31 +91,17 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1685801374,
|
|
||||||
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-23.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks": {
|
"pre-commit-hooks": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils",
|
||||||
"gitignore": "gitignore",
|
"gitignore": "gitignore",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
],
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703939133,
|
"lastModified": 1703939133,
|
||||||
|
@ -131,7 +119,7 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
}
|
}
|
||||||
|
@ -150,21 +138,6 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
161
flake.nix
161
flake.nix
|
@ -2,158 +2,29 @@
|
||||||
description = "A neovim configuration system for NixOS";
|
description = "A neovim configuration system for NixOS";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
flake-parts = {
|
||||||
|
url = "github:hercules-ci/flake-parts";
|
||||||
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
pre-commit-hooks = {
|
||||||
url = "github:cachix/pre-commit-hooks.nix";
|
url = "github:cachix/pre-commit-hooks.nix";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.nixpkgs-stable.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = inputs:
|
||||||
self,
|
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
|
||||||
nixpkgs,
|
systems = [
|
||||||
flake-utils,
|
"x86_64-linux"
|
||||||
pre-commit-hooks,
|
"aarch64-linux"
|
||||||
...
|
"x86_64-darwin"
|
||||||
} @ inputs:
|
"aarch64-darwin"
|
||||||
with nixpkgs.lib;
|
];
|
||||||
with builtins; let
|
|
||||||
# TODO: Support nesting
|
|
||||||
nixvimModules = map (f: ./modules + "/${f}") (attrNames (builtins.readDir ./modules));
|
|
||||||
|
|
||||||
modules = pkgs:
|
imports = [./flake-modules];
|
||||||
nixvimModules
|
};
|
||||||
++ [
|
|
||||||
rec {
|
|
||||||
_file = ./flake.nix;
|
|
||||||
key = _file;
|
|
||||||
config = {
|
|
||||||
_module.args = {
|
|
||||||
pkgs = mkForce pkgs;
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
helpers = import ./plugins/helpers.nix {inherit (pkgs) lib;};
|
|
||||||
inherit inputs;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
(pkgs.path + "/nixos/modules/misc/meta.nix")
|
|
||||||
# ./plugins/default.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
wrapperArgs = {
|
|
||||||
inherit modules;
|
|
||||||
inherit self;
|
|
||||||
};
|
|
||||||
|
|
||||||
flakeOutput =
|
|
||||||
flake-utils.lib.eachDefaultSystem
|
|
||||||
(system: let
|
|
||||||
pkgs = import nixpkgs {inherit system;};
|
|
||||||
# Some nixvim supported plugins require the use of unfree packages.
|
|
||||||
# This unfree-friendly pkgs is used for documentation and testing only.
|
|
||||||
pkgs-unfree = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
checks = {
|
|
||||||
tests = import ./tests {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
# Some nixvim supported plugins require the use of unfree packages.
|
|
||||||
# As we test as many things as possible, we need to allow unfree sources by generating
|
|
||||||
# a separate `makeNixvim` module (with pkgs-unfree).
|
|
||||||
makeNixvim = let
|
|
||||||
makeNixvimWithModuleUnfree = import ./wrappers/standalone.nix pkgs-unfree wrapperArgs;
|
|
||||||
in
|
|
||||||
configuration:
|
|
||||||
makeNixvimWithModuleUnfree {
|
|
||||||
module = {
|
|
||||||
config = configuration;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
lib-tests = import ./tests/lib-tests.nix {
|
|
||||||
inherit (pkgs) pkgs lib;
|
|
||||||
};
|
|
||||||
extra-args-tests = import ./tests/extra-args.nix {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (self.legacyPackages.${system}) makeNixvimWithModule;
|
|
||||||
};
|
|
||||||
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
||||||
src = ./.;
|
|
||||||
hooks = {
|
|
||||||
alejandra = {
|
|
||||||
enable = true;
|
|
||||||
excludes = ["plugins/_sources"];
|
|
||||||
};
|
|
||||||
statix.enable = true;
|
|
||||||
};
|
|
||||||
settings.statix.ignore = ["plugins/lsp/language-servers/rust-analyzer-config.nix"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
devShells = {
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
packages =
|
|
||||||
{
|
|
||||||
docs = pkgs-unfree.callPackage (import ./docs) {
|
|
||||||
modules = modules pkgs;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// (import ./helpers pkgs)
|
|
||||||
// (import ./man-docs {
|
|
||||||
pkgs = pkgs-unfree;
|
|
||||||
modules = modules pkgs;
|
|
||||||
});
|
|
||||||
legacyPackages = rec {
|
|
||||||
makeNixvimWithModule = import ./wrappers/standalone.nix pkgs wrapperArgs;
|
|
||||||
makeNixvim = configuration:
|
|
||||||
makeNixvimWithModule {
|
|
||||||
module = {
|
|
||||||
config = configuration;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
formatter = pkgs.alejandra;
|
|
||||||
lib = import ./lib {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
inherit (self.legacyPackages."${system}") makeNixvim;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
in
|
|
||||||
flakeOutput
|
|
||||||
// {
|
|
||||||
nixosModules.nixvim = import ./wrappers/nixos.nix wrapperArgs;
|
|
||||||
homeManagerModules.nixvim = import ./wrappers/hm.nix wrapperArgs;
|
|
||||||
nixDarwinModules.nixvim = import ./wrappers/darwin.nix wrapperArgs;
|
|
||||||
rawModules.nixvim = nixvimModules;
|
|
||||||
|
|
||||||
overlays.default = final: prev: {
|
|
||||||
nixvim = rec {
|
|
||||||
makeNixvimWithModule = import ./wrappers/standalone.nix prev wrapperArgs;
|
|
||||||
makeNixvim = configuration:
|
|
||||||
makeNixvimWithModule {
|
|
||||||
module = {
|
|
||||||
config = configuration;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
templates = let
|
|
||||||
simple = {
|
|
||||||
path = ./templates/simple;
|
|
||||||
description = "A simple nix flake template for getting started with nixvim";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
default = simple;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue