This commit is contained in:
poz 2026-05-17 12:37:47 +00:00 committed by GitHub
commit 3e21b86588
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 270 additions and 313 deletions

View file

@ -500,6 +500,7 @@ https://github.com/gorbit99/codewindow.nvim
[fish_indent]. Most of the work done by
[poseidon-rises](https://github.com/poseidon-rises) in
[!1107](https://github.com/NotAShelf/nvf/pull/1107).
- Remove `flake-parts` and `nix-systems` from flake.
[emo-mruczek](https://emo-mruczek.pet):

47
flake.lock generated
View file

@ -3,11 +3,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1751685974,
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
"lastModified": 1777699697,
"narHash": "sha256-Eg9b/rq/ECYwNwEXs5i9wHyhxNI0JrYx2srdI2uZMaQ=",
"ref": "refs/heads/main",
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
"revCount": 92,
"rev": "382052b74656a369c5408822af3f2501e9b1af81",
"revCount": 94,
"type": "git",
"url": "https://git.lix.systems/lix-project/flake-compat.git"
},
@ -16,26 +16,6 @@
"url": "https://git.lix.systems/lix-project/flake-compat.git"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769996383,
"narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "57928607ea566b5db3ad13af0e57e921e6b12381",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"mnw": {
"locked": {
"lastModified": 1777828893,
@ -91,26 +71,9 @@
"root": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"mnw": "mnw",
"ndg": "ndg",
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

111
flake.nix
View file

@ -1,30 +1,26 @@
{
description = "A neovim flake with a modular configuration";
outputs = {
flake-parts,
self,
nixpkgs,
...
} @ inputs: let
systems = nixpkgs.lib.platforms.all;
# Provide simple per-system abstraction
# either giving you the system directly
# or the package set for that system.
eachSystem = nixpkgs.lib.genAttrs systems;
eachSystemPkgs = f:
nixpkgs.lib.genAttrs systems
(system: f nixpkgs.legacyPackages.${system});
# Call the extended library with `inputs`.
# inputs is used to get the original standard library, and to pass inputs
# to the plugin autodiscovery function
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
in
flake-parts.lib.mkFlake {
inherit inputs;
specialArgs = {inherit lib;};
} {
# Allow users to bring their own systems.
# «https://github.com/nix-systems/nix-systems»
systems = import inputs.systems;
imports = [
./flake/templates
./flake/apps.nix
./flake/packages.nix
./flake/develop.nix
];
flake = {
in {
lib = {
inherit (lib) nvim;
inherit (lib.nvim) neovimConfiguration;
@ -58,14 +54,14 @@
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
default = self.darwinModules.nvf;
};
};
perSystem = {pkgs, ...}: {
# Provides the default formatter for 'nix fmt', which will format the
# entire Nix source 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 {
formatter = eachSystemPkgs (
pkgs:
pkgs.writeShellApplication {
name = "nix3-fmt-wrapper";
runtimeInputs = [
@ -83,11 +79,12 @@
echo "Formatting Markdown files"
fd "$@" -t f -e md -x deno fmt -q '{}'
'';
};
}
);
# Provides checks to be built an ran on 'nix flake check'. They can also
# be built individually with 'nix build' as described below.
checks = {
checks = eachSystemPkgs (pkgs: {
# Check if codebase is properly formatted.
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
# or with `nix flake check`
@ -114,21 +111,77 @@
fd -t f -e md -x deno fmt --check '{}'
touch $out
'';
});
templates = import ./flake/templates;
apps = eachSystem (system: let
inherit (lib.meta) getExe;
in {
nix = {
type = "app";
program = getExe self.packages.${system}.nix;
meta = {};
};
maximal = {
type = "app";
program = getExe self.packages.${system}.maximal;
meta = {};
};
default = self.apps.${system}.nix;
});
packages = let
inherit (lib.attrsets) recursiveUpdate;
in
recursiveUpdate
(eachSystem (system: import ./flake/packages.nix {inherit inputs lib self system;}))
(eachSystemPkgs (pkgs: {
# This package exists to make development easier by providing the place and
# boilerplate to build a test nvf configuration. Feel free to use this for
# testing, but make sure to discard the changes before creating a pull
# request.
dev = let
configuration = {
# This is essentially the configuration that will be passed to the
# builder function. For example:
# vim.languages.nix.enable = true;
};
customNeovim = lib.nvim.neovimConfiguration {
inherit pkgs;
modules = [configuration];
};
in
customNeovim.neovim;
}));
devShells = eachSystemPkgs (pkgs: {
# The default dev shell provides packages required to interact with
# the codebase as described by the contributing guidelines. It includes the
# formatters required, and a few additional goodies for linting work.
default = pkgs.mkShellNoCC {
packages = with pkgs; [
# Nix tooling
nil # LSP
statix # static checker
deadnix # dead code finder
# So that we can interact with plugin sources
npins
# Formatters
alejandra
deno
];
};
});
};
inputs = {
systems.url = "github:nix-systems/default";
## Basic Inputs
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-compat = {
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
flake = false;

View file

@ -1,11 +0,0 @@
{lib, ...}: let
inherit (lib.meta) getExe;
in {
perSystem = {config, ...}: {
apps = {
nix.program = getExe config.packages.nix;
maximal.program = getExe config.packages.maximal;
default = config.apps.nix;
};
};
}

View file

@ -1,42 +0,0 @@
{lib, ...}: {
perSystem = {pkgs, ...}: {
# The default dev shell provides packages required to interact with
# the codebase as described by the contributing guidelines. It includes the
# formatters required, and a few additional goodies for linting work.
devShells = {
default = pkgs.mkShellNoCC {
packages = with pkgs; [
# Nix tooling
nil # LSP
statix # static checker
deadnix # dead code finder
# So that we can interact with plugin sources
npins
# Formatters
alejandra
deno
];
};
};
# This package exists to make development easier by providing the place and
# boilerplate to build a test nvf configuration. Feel free to use this for
# testing, but make sure to discard the changes before creating a pull
# request.
packages.dev = let
configuration = {
# This is essentially the configuration that will be passed to the
# builder function. For example:
# vim.languages.nix.enable = true;
};
customNeovim = lib.nvim.neovimConfiguration {
inherit pkgs;
modules = [configuration];
};
in
customNeovim.neovim;
};
}

View file

@ -1,14 +1,12 @@
{
inputs,
self,
...
} @ args: {
perSystem = {
config,
pkgs,
lib,
self,
system,
...
}: let
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (lib.customisation) makeScope;
inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs;
inherit (lib.strings) concatStringsSep;
@ -20,7 +18,7 @@
# Helper function for creating demo configurations for nvf
# TODO: make this more generic.
buildPkg = maximal:
(args.config.flake.lib.nvim.neovimConfiguration {
(lib.nvim.neovimConfiguration {
inherit pkgs;
modules = [(import ../configuration.nix maximal)];
}).neovim;
@ -56,8 +54,7 @@
};
legacyPackages = scopeFromDirectory ./pkgs/by-name;
in {
packages =
in
(flattenPkgs "/" [] legacyPackages)
// {
inherit (docs.manual) htmlOpenTool;
@ -68,7 +65,7 @@
docs-manpages = docs.manPages;
docs-json = docs.options.json;
docs-linkcheck = let
site = config.packages.docs;
site = self.packages.${system}.docs;
in
pkgs.testers.lycheeLinkCheck {
inherit site;
@ -121,7 +118,5 @@
# Exposed neovim configurations
nix = buildPkg false;
maximal = buildPkg true;
default = config.packages.nix;
};
};
default = self.packages.${system}.nix;
}

View file

@ -1,5 +1,4 @@
{
flake.templates = {
standalone = {
path = ./standalone;
description = "Standalone flake template for nvf";
@ -13,5 +12,4 @@
Happy editing!
'';
};
};
}