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-07-20 13:37:42 +03:00
|
|
|
# Call the extended library with `inputs`.
|
|
|
|
|
# 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/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
|
|
|
|
2025-07-20 13:37:42 +03:00
|
|
|
inherit (lib.importJSON ./npins/sources.json) pins;
|
|
|
|
|
|
2023-04-02 19:10:24 +03:00
|
|
|
homeManagerModules = {
|
2025-02-16 12:35:13 +01:00
|
|
|
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
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 = {
|
2025-02-16 12:35:13 +01:00
|
|
|
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
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
|
|
|
};
|
2023-02-01 23:59:35 +03:00
|
|
|
};
|
|
|
|
|
|
2024-11-12 22:34:13 +01:00
|
|
|
perSystem = {pkgs, ...}: {
|
2025-07-20 13:37:42 +03:00
|
|
|
# Provides the default formatter for 'nix fmt', which will format the
|
|
|
|
|
# entire tree with Alejandra. The wrapper script is necessary due to
|
|
|
|
|
# changes to the behaviour of Nix, which now encourages wrappers for
|
|
|
|
|
# tree-wide formatting.
|
|
|
|
|
formatter = pkgs.writeShellApplication {
|
|
|
|
|
name = "nix3-fmt-wrapper";
|
|
|
|
|
|
|
|
|
|
runtimeInputs = [
|
|
|
|
|
pkgs.alejandra
|
|
|
|
|
pkgs.fd
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
text = ''
|
|
|
|
|
# Find Nix files in the tree and format them with Alejandra
|
|
|
|
|
fd "$@" -t f -e nix -x alejandra -q '{}'
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-09-28 23:32:25 +03:00
|
|
|
|
2025-07-20 13:37:42 +03:00
|
|
|
# Provides checks to be built an ran on 'nix flake check'. They can also
|
|
|
|
|
# be built individually with 'nix build' as described below.
|
2024-09-28 23:32:25 +03:00
|
|
|
checks = {
|
2025-07-20 13:37:42 +03:00
|
|
|
# Check if codebase is properly formatted.
|
|
|
|
|
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
|
|
|
|
# or with `nix flake check`
|
2024-09-28 23:32:25 +03:00
|
|
|
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
|
|
|
|
2023-02-01 22:11:37 +03:00
|
|
|
inputs = {
|
2025-07-20 13:37:42 +03:00
|
|
|
systems.url = "github:nix-systems/default";
|
|
|
|
|
|
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";
|
2025-07-10 18:50:30 +02:00
|
|
|
|
|
|
|
|
flake-parts = {
|
|
|
|
|
url = "github:hercules-ci/flake-parts";
|
|
|
|
|
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
flake-utils = {
|
|
|
|
|
url = "github:numtide/flake-utils";
|
|
|
|
|
inputs.systems.follows = "systems";
|
|
|
|
|
};
|
|
|
|
|
|
2025-07-20 13:37:42 +03:00
|
|
|
flake-compat = {
|
|
|
|
|
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
|
|
|
|
|
flake = false;
|
|
|
|
|
};
|
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";
|
2023-02-01 23:59:35 +03:00
|
|
|
};
|
2023-02-01 22:11:37 +03:00
|
|
|
}
|