mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-22 14:43:55 +00:00
Merge 3bc7761c1c into cd45295f9c
This commit is contained in:
commit
3e21b86588
7 changed files with 270 additions and 313 deletions
|
|
@ -500,6 +500,7 @@ https://github.com/gorbit99/codewindow.nvim
|
||||||
[fish_indent]. Most of the work done by
|
[fish_indent]. Most of the work done by
|
||||||
[poseidon-rises](https://github.com/poseidon-rises) in
|
[poseidon-rises](https://github.com/poseidon-rises) in
|
||||||
[!1107](https://github.com/NotAShelf/nvf/pull/1107).
|
[!1107](https://github.com/NotAShelf/nvf/pull/1107).
|
||||||
|
- Remove `flake-parts` and `nix-systems` from flake.
|
||||||
|
|
||||||
[emo-mruczek](https://emo-mruczek.pet):
|
[emo-mruczek](https://emo-mruczek.pet):
|
||||||
|
|
||||||
|
|
|
||||||
47
flake.lock
generated
47
flake.lock
generated
|
|
@ -3,11 +3,11 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751685974,
|
"lastModified": 1777699697,
|
||||||
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
|
"narHash": "sha256-Eg9b/rq/ECYwNwEXs5i9wHyhxNI0JrYx2srdI2uZMaQ=",
|
||||||
"ref": "refs/heads/main",
|
"ref": "refs/heads/main",
|
||||||
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
|
"rev": "382052b74656a369c5408822af3f2501e9b1af81",
|
||||||
"revCount": 92,
|
"revCount": 94,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.lix.systems/lix-project/flake-compat.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"
|
"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": {
|
"mnw": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1777828893,
|
"lastModified": 1777828893,
|
||||||
|
|
@ -91,26 +71,9 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
"ndg": "ndg",
|
||||||
"nixpkgs": "nixpkgs",
|
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
111
flake.nix
111
flake.nix
|
|
@ -1,30 +1,26 @@
|
||||||
{
|
{
|
||||||
description = "A neovim flake with a modular configuration";
|
description = "A neovim flake with a modular configuration";
|
||||||
outputs = {
|
outputs = {
|
||||||
flake-parts,
|
|
||||||
self,
|
self,
|
||||||
|
nixpkgs,
|
||||||
...
|
...
|
||||||
} @ inputs: let
|
} @ 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`.
|
# Call the extended library with `inputs`.
|
||||||
# inputs is used to get the original standard library, and to pass inputs
|
# inputs is used to get the original standard library, and to pass inputs
|
||||||
# to the plugin autodiscovery function
|
# to the plugin autodiscovery function
|
||||||
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
||||||
in
|
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 = {
|
|
||||||
lib = {
|
lib = {
|
||||||
inherit (lib) nvim;
|
inherit (lib) nvim;
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
inherit (lib.nvim) neovimConfiguration;
|
||||||
|
|
@ -58,14 +54,14 @@
|
||||||
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
||||||
default = self.darwinModules.nvf;
|
default = self.darwinModules.nvf;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
perSystem = {pkgs, ...}: {
|
|
||||||
# Provides the default formatter for 'nix fmt', which will format the
|
# Provides the default formatter for 'nix fmt', which will format the
|
||||||
# entire Nix source with Alejandra. The wrapper script is necessary due to
|
# entire Nix source with Alejandra. The wrapper script is necessary due to
|
||||||
# changes to the behaviour of Nix, which now encourages wrappers for
|
# changes to the behaviour of Nix, which now encourages wrappers for
|
||||||
# tree-wide formatting.
|
# tree-wide formatting.
|
||||||
formatter = pkgs.writeShellApplication {
|
formatter = eachSystemPkgs (
|
||||||
|
pkgs:
|
||||||
|
pkgs.writeShellApplication {
|
||||||
name = "nix3-fmt-wrapper";
|
name = "nix3-fmt-wrapper";
|
||||||
|
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
|
|
@ -83,11 +79,12 @@
|
||||||
echo "Formatting Markdown files"
|
echo "Formatting Markdown files"
|
||||||
fd "$@" -t f -e md -x deno fmt -q '{}'
|
fd "$@" -t f -e md -x deno fmt -q '{}'
|
||||||
'';
|
'';
|
||||||
};
|
}
|
||||||
|
);
|
||||||
|
|
||||||
# Provides checks to be built an ran on 'nix flake check'. They can also
|
# Provides checks to be built an ran on 'nix flake check'. They can also
|
||||||
# be built individually with 'nix build' as described below.
|
# be built individually with 'nix build' as described below.
|
||||||
checks = {
|
checks = eachSystemPkgs (pkgs: {
|
||||||
# Check if codebase is properly formatted.
|
# Check if codebase is properly formatted.
|
||||||
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
# This can be initiated with `nix build .#checks.<system>.nix-fmt`
|
||||||
# or with `nix flake check`
|
# or with `nix flake check`
|
||||||
|
|
@ -114,21 +111,77 @@
|
||||||
fd -t f -e md -x deno fmt --check '{}'
|
fd -t f -e md -x deno fmt --check '{}'
|
||||||
touch $out
|
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 = {
|
inputs = {
|
||||||
systems.url = "github:nix-systems/default";
|
|
||||||
|
|
||||||
## Basic Inputs
|
## Basic Inputs
|
||||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
|
||||||
flake-parts = {
|
|
||||||
url = "github:hercules-ci/flake-parts";
|
|
||||||
inputs.nixpkgs-lib.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
|
url = "git+https://git.lix.systems/lix-project/flake-compat.git";
|
||||||
flake = false;
|
flake = false;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
self,
|
|
||||||
...
|
|
||||||
} @ args: {
|
|
||||||
perSystem = {
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
|
self,
|
||||||
|
system,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
inherit (lib.customisation) makeScope;
|
inherit (lib.customisation) makeScope;
|
||||||
inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs;
|
inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs;
|
||||||
inherit (lib.strings) concatStringsSep;
|
inherit (lib.strings) concatStringsSep;
|
||||||
|
|
@ -20,7 +18,7 @@
|
||||||
# Helper function for creating demo configurations for nvf
|
# Helper function for creating demo configurations for nvf
|
||||||
# TODO: make this more generic.
|
# TODO: make this more generic.
|
||||||
buildPkg = maximal:
|
buildPkg = maximal:
|
||||||
(args.config.flake.lib.nvim.neovimConfiguration {
|
(lib.nvim.neovimConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [(import ../configuration.nix maximal)];
|
modules = [(import ../configuration.nix maximal)];
|
||||||
}).neovim;
|
}).neovim;
|
||||||
|
|
@ -56,8 +54,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages = scopeFromDirectory ./pkgs/by-name;
|
legacyPackages = scopeFromDirectory ./pkgs/by-name;
|
||||||
in {
|
in
|
||||||
packages =
|
|
||||||
(flattenPkgs "/" [] legacyPackages)
|
(flattenPkgs "/" [] legacyPackages)
|
||||||
// {
|
// {
|
||||||
inherit (docs.manual) htmlOpenTool;
|
inherit (docs.manual) htmlOpenTool;
|
||||||
|
|
@ -68,7 +65,7 @@
|
||||||
docs-manpages = docs.manPages;
|
docs-manpages = docs.manPages;
|
||||||
docs-json = docs.options.json;
|
docs-json = docs.options.json;
|
||||||
docs-linkcheck = let
|
docs-linkcheck = let
|
||||||
site = config.packages.docs;
|
site = self.packages.${system}.docs;
|
||||||
in
|
in
|
||||||
pkgs.testers.lycheeLinkCheck {
|
pkgs.testers.lycheeLinkCheck {
|
||||||
inherit site;
|
inherit site;
|
||||||
|
|
@ -121,7 +118,5 @@
|
||||||
# Exposed neovim configurations
|
# Exposed neovim configurations
|
||||||
nix = buildPkg false;
|
nix = buildPkg false;
|
||||||
maximal = buildPkg true;
|
maximal = buildPkg true;
|
||||||
default = config.packages.nix;
|
default = self.packages.${system}.nix;
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
flake.templates = {
|
|
||||||
standalone = {
|
standalone = {
|
||||||
path = ./standalone;
|
path = ./standalone;
|
||||||
description = "Standalone flake template for nvf";
|
description = "Standalone flake template for nvf";
|
||||||
|
|
@ -13,5 +12,4 @@
|
||||||
Happy editing!
|
Happy editing!
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue