2023-02-01 22:11:37 +03:00
|
|
|
{
|
2023-02-01 23:59:35 +03:00
|
|
|
description = "A neovim flake with a modular configuration";
|
|
|
|
outputs = {
|
2023-02-07 14:03:21 +02:00
|
|
|
flake-parts,
|
2023-04-01 00:57:25 +03:00
|
|
|
self,
|
2023-02-01 23:59:35 +03:00
|
|
|
...
|
2024-07-12 00:49:44 +02:00
|
|
|
} @ inputs: let
|
2025-01-17 09:54:51 +01:00
|
|
|
# call the extended library with `inputs`
|
2024-07-12 00:49:44 +02:00
|
|
|
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
2025-02-06 17:43:54 +03:00
|
|
|
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
2024-07-12 00:49:44 +02:00
|
|
|
in
|
|
|
|
flake-parts.lib.mkFlake {
|
|
|
|
inherit inputs;
|
|
|
|
specialArgs = {inherit lib;};
|
|
|
|
} {
|
2024-09-28 23:32:25 +03:00
|
|
|
# Allow users to bring their own systems.
|
|
|
|
# «https://github.com/nix-systems/nix-systems»
|
2023-09-28 12:07:36 +03:00
|
|
|
systems = import inputs.systems;
|
2023-02-10 19:40:13 +02:00
|
|
|
imports = [
|
2025-02-03 14:47:35 +03:00
|
|
|
./flake/templates
|
|
|
|
|
2023-02-10 19:40:13 +02:00
|
|
|
./flake/apps.nix
|
|
|
|
./flake/legacyPackages.nix
|
2023-02-10 19:45:23 +02:00
|
|
|
./flake/overlays.nix
|
2023-02-10 19:40:13 +02:00
|
|
|
./flake/packages.nix
|
2024-11-12 22:34:13 +01:00
|
|
|
./flake/develop.nix
|
2023-02-10 19:40:13 +02:00
|
|
|
];
|
|
|
|
|
2023-02-07 14:03:21 +02:00
|
|
|
flake = {
|
|
|
|
lib = {
|
2024-07-20 10:22:13 +02:00
|
|
|
inherit (lib) nvim;
|
|
|
|
inherit (lib.nvim) neovimConfiguration;
|
2023-02-06 04:14:01 +03:00
|
|
|
};
|
2023-02-06 05:26:52 +03:00
|
|
|
|
2023-04-02 19:10:24 +03:00
|
|
|
homeManagerModules = {
|
2024-12-29 18:46:55 +01:00
|
|
|
nvf = import ./flake/modules/home-manager.nix {inherit lib self;};
|
2024-11-04 17:00:28 +03:00
|
|
|
default = self.homeManagerModules.nvf;
|
2024-04-27 15:51:22 +03:00
|
|
|
neovim-flake =
|
2024-07-12 00:49:44 +02:00
|
|
|
lib.warn ''
|
2024-11-04 17:00:28 +03:00
|
|
|
'homeManagerModules.neovim-flake' has been deprecated, and will be removed
|
|
|
|
in a future release. Please use 'homeManagerModules.nvf' instead.
|
2024-04-27 15:51:22 +03:00
|
|
|
''
|
|
|
|
self.homeManagerModules.nvf;
|
2023-03-29 16:20:43 +03:00
|
|
|
};
|
2024-04-14 16:51:20 +03:00
|
|
|
|
|
|
|
nixosModules = {
|
2024-12-29 18:47:22 +01:00
|
|
|
nvf = import ./flake/modules/nixos.nix {inherit lib self;};
|
2024-11-04 17:00:28 +03:00
|
|
|
default = self.nixosModules.nvf;
|
2024-04-27 15:51:22 +03:00
|
|
|
neovim-flake =
|
2024-07-12 00:49:44 +02:00
|
|
|
lib.warn ''
|
2024-11-04 17:00:28 +03:00
|
|
|
'nixosModules.neovim-flake' has been deprecated, and will be removed
|
|
|
|
in a future release. Please use 'nixosModules.nvf' instead.
|
2024-04-27 15:51:22 +03:00
|
|
|
''
|
2024-05-16 19:08:21 +03:00
|
|
|
self.nixosModules.nvf;
|
2024-04-14 16:51:20 +03:00
|
|
|
};
|
2025-02-05 06:52:24 +03:00
|
|
|
|
2025-02-06 17:43:54 +03:00
|
|
|
inherit (lib.importJSON ./npins/sources.json) pins;
|
2023-02-01 23:59:35 +03:00
|
|
|
};
|
|
|
|
|
2024-11-12 22:34:13 +01:00
|
|
|
perSystem = {pkgs, ...}: {
|
2024-09-28 23:32:25 +03:00
|
|
|
# Provide the default formatter. `nix fmt` in project root
|
|
|
|
# will format available files with the correct formatter.
|
|
|
|
# P.S: Please do not format with nixfmt! It messes with many
|
|
|
|
# syntax elements and results in unreadable code.
|
|
|
|
formatter = pkgs.alejandra;
|
|
|
|
|
|
|
|
# Check if codebase is properly formatted.
|
|
|
|
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
|
|
|
# or with `nix flake check`
|
|
|
|
checks = {
|
|
|
|
nix-fmt = pkgs.runCommand "nix-fmt-check" {nativeBuildInputs = [pkgs.alejandra];} ''
|
|
|
|
alejandra --check ${self} < /dev/null | tee $out
|
|
|
|
'';
|
|
|
|
};
|
2023-02-07 14:03:21 +02:00
|
|
|
};
|
|
|
|
};
|
2023-02-06 21:57:52 +03:00
|
|
|
|
|
|
|
# Flake inputs
|
2023-02-01 22:11:37 +03:00
|
|
|
inputs = {
|
2024-05-06 22:30:06 +03:00
|
|
|
## Basic Inputs
|
2024-06-22 19:28:54 -04:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2023-02-07 14:03:21 +02:00
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
2023-02-15 11:46:29 +03:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-09-28 12:07:36 +03:00
|
|
|
systems.url = "github:nix-systems/default";
|
2023-02-04 01:45:31 +03:00
|
|
|
|
2024-07-13 15:05:21 +00:00
|
|
|
# Alternate neovim-wrapper
|
2024-07-14 03:47:21 +00:00
|
|
|
mnw.url = "github:Gerg-L/mnw";
|
2024-07-13 15:05:21 +00:00
|
|
|
|
2023-02-01 22:11:37 +03:00
|
|
|
# For generating documentation website
|
|
|
|
nmd = {
|
2023-12-09 22:03:58 +03:00
|
|
|
url = "sourcehut:~rycee/nmd";
|
2023-02-01 22:11:37 +03:00
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
|
2024-09-24 06:05:47 +03:00
|
|
|
# Language servers (use master instead of nixpkgs)
|
2024-04-08 03:28:49 +03:00
|
|
|
nil = {
|
|
|
|
url = "github:oxalica/nil";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
|
|
|
};
|
2025-02-06 17:43:54 +03:00
|
|
|
|
|
|
|
blink-cmp = {
|
|
|
|
url = "github:saghen/blink.cmp";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-02-01 23:59:35 +03:00
|
|
|
};
|
2023-02-01 22:11:37 +03:00
|
|
|
}
|