mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-05-19 05:24:22 +00:00
flake: remove flake-parts and nix-systems from flake
This commit is contained in:
parent
cd45295f9c
commit
3bc7761c1c
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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
235
flake.nix
235
flake.nix
|
|
@ -1,71 +1,67 @@
|
||||||
{
|
{
|
||||||
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 {
|
lib = {
|
||||||
inherit inputs;
|
inherit (lib) nvim;
|
||||||
specialArgs = {inherit lib;};
|
inherit (lib.nvim) neovimConfiguration;
|
||||||
} {
|
};
|
||||||
# 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 = {
|
inherit (lib.importJSON ./npins/sources.json) pins;
|
||||||
lib = {
|
|
||||||
inherit (lib) nvim;
|
|
||||||
inherit (lib.nvim) neovimConfiguration;
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit (lib.importJSON ./npins/sources.json) pins;
|
homeManagerModules = {
|
||||||
|
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
||||||
|
default = self.homeManagerModules.nvf;
|
||||||
|
neovim-flake =
|
||||||
|
lib.warn ''
|
||||||
|
'homeManagerModules.neovim-flake' has been deprecated, and will be removed
|
||||||
|
in a future release. Please use 'homeManagerModules.nvf' instead.
|
||||||
|
''
|
||||||
|
self.homeManagerModules.nvf;
|
||||||
|
};
|
||||||
|
|
||||||
homeManagerModules = {
|
nixosModules = {
|
||||||
nvf = import ./flake/modules/home-manager.nix {inherit lib inputs;};
|
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
||||||
default = self.homeManagerModules.nvf;
|
default = self.nixosModules.nvf;
|
||||||
neovim-flake =
|
neovim-flake =
|
||||||
lib.warn ''
|
lib.warn ''
|
||||||
'homeManagerModules.neovim-flake' has been deprecated, and will be removed
|
'nixosModules.neovim-flake' has been deprecated, and will be removed
|
||||||
in a future release. Please use 'homeManagerModules.nvf' instead.
|
in a future release. Please use 'nixosModules.nvf' instead.
|
||||||
''
|
''
|
||||||
self.homeManagerModules.nvf;
|
self.nixosModules.nvf;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules = {
|
darwinModules = {
|
||||||
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
||||||
default = self.nixosModules.nvf;
|
default = self.darwinModules.nvf;
|
||||||
neovim-flake =
|
};
|
||||||
lib.warn ''
|
|
||||||
'nixosModules.neovim-flake' has been deprecated, and will be removed
|
|
||||||
in a future release. Please use 'nixosModules.nvf' instead.
|
|
||||||
''
|
|
||||||
self.nixosModules.nvf;
|
|
||||||
};
|
|
||||||
|
|
||||||
darwinModules = {
|
# Provides the default formatter for 'nix fmt', which will format the
|
||||||
nvf = import ./flake/modules/nixos.nix {inherit lib inputs;};
|
# entire Nix source with Alejandra. The wrapper script is necessary due to
|
||||||
default = self.darwinModules.nvf;
|
# changes to the behaviour of Nix, which now encourages wrappers for
|
||||||
};
|
# tree-wide formatting.
|
||||||
};
|
formatter = eachSystemPkgs (
|
||||||
|
pkgs:
|
||||||
perSystem = {pkgs, ...}: {
|
pkgs.writeShellApplication {
|
||||||
# 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 {
|
|
||||||
name = "nix3-fmt-wrapper";
|
name = "nix3-fmt-wrapper";
|
||||||
|
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
|
|
@ -83,52 +79,109 @@
|
||||||
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`
|
||||||
nix-fmt =
|
nix-fmt =
|
||||||
pkgs.runCommand "nix-fmt-check"
|
pkgs.runCommand "nix-fmt-check"
|
||||||
{
|
{
|
||||||
src = self;
|
src = self;
|
||||||
nativeBuildInputs = [pkgs.alejandra pkgs.fd];
|
nativeBuildInputs = [pkgs.alejandra pkgs.fd];
|
||||||
} ''
|
} ''
|
||||||
cd "$src"
|
cd "$src"
|
||||||
fd -t f -e nix -x alejandra --check '{}'
|
fd -t f -e nix -x alejandra --check '{}'
|
||||||
touch $out
|
touch $out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Check if Markdown sources are properly formatted
|
# Check if Markdown sources are properly formatted
|
||||||
# This can be initiated with `nix build .#checks.<system>.md-fmt`
|
# This can be initiated with `nix build .#checks.<system>.md-fmt`
|
||||||
# or with `nix flake check`
|
# or with `nix flake check`
|
||||||
md-fmt =
|
md-fmt =
|
||||||
pkgs.runCommand "md-fmt-check" {
|
pkgs.runCommand "md-fmt-check" {
|
||||||
src = self;
|
src = self;
|
||||||
nativeBuildInputs = [pkgs.deno pkgs.fd];
|
nativeBuildInputs = [pkgs.deno pkgs.fd];
|
||||||
} ''
|
} ''
|
||||||
cd "$src"
|
cd "$src"
|
||||||
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,127 +1,122 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
|
lib,
|
||||||
self,
|
self,
|
||||||
|
system,
|
||||||
...
|
...
|
||||||
} @ args: {
|
}: let
|
||||||
perSystem = {
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.customisation) makeScope;
|
|
||||||
inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs;
|
|
||||||
inherit (lib.strings) concatStringsSep;
|
|
||||||
inherit (lib.filesystem) packagesFromDirectoryRecursive;
|
|
||||||
|
|
||||||
# Entrypoint for nvf documentation and relevant packages.
|
inherit (lib.customisation) makeScope;
|
||||||
docs = import ../docs {inherit pkgs inputs lib;};
|
inherit (lib.attrsets) isDerivation isAttrs concatMapAttrs;
|
||||||
|
inherit (lib.strings) concatStringsSep;
|
||||||
|
inherit (lib.filesystem) packagesFromDirectoryRecursive;
|
||||||
|
|
||||||
# Helper function for creating demo configurations for nvf
|
# Entrypoint for nvf documentation and relevant packages.
|
||||||
# TODO: make this more generic.
|
docs = import ../docs {inherit pkgs inputs lib;};
|
||||||
buildPkg = maximal:
|
|
||||||
(args.config.flake.lib.nvim.neovimConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [(import ../configuration.nix maximal)];
|
|
||||||
}).neovim;
|
|
||||||
|
|
||||||
# This constructs a by-name overlay similar to the one found in Nixpkgs.
|
# Helper function for creating demo configurations for nvf
|
||||||
# The goal is to automatically discover and packages found in pkgs/by-name
|
# TODO: make this more generic.
|
||||||
# as long as they have a 'package.nix' in the package directory. We also
|
buildPkg = maximal:
|
||||||
# pass 'inputs' and 'pins' to all packages in the 'callPackage' scope, therefore
|
(lib.nvim.neovimConfiguration {
|
||||||
# they are always available in the relevant 'package.nix' files.
|
inherit pkgs;
|
||||||
# ---
|
modules = [(import ../configuration.nix maximal)];
|
||||||
# The logic is borrowed from drupol/pkgs-by-name-for-flake-parts, available
|
}).neovim;
|
||||||
# under the MIT license.
|
|
||||||
flattenPkgs = separator: path: value:
|
|
||||||
if isDerivation value
|
|
||||||
then {
|
|
||||||
${concatStringsSep separator path} = value;
|
|
||||||
}
|
|
||||||
else if isAttrs value
|
|
||||||
then concatMapAttrs (name: flattenPkgs separator (path ++ [name])) value
|
|
||||||
else
|
|
||||||
# Ignore the functions which makeScope returns
|
|
||||||
{};
|
|
||||||
|
|
||||||
inputsScope = makeScope pkgs.newScope (_: {
|
# This constructs a by-name overlay similar to the one found in Nixpkgs.
|
||||||
inherit inputs;
|
# The goal is to automatically discover and packages found in pkgs/by-name
|
||||||
inherit (self) pins;
|
# as long as they have a 'package.nix' in the package directory. We also
|
||||||
});
|
# pass 'inputs' and 'pins' to all packages in the 'callPackage' scope, therefore
|
||||||
|
# they are always available in the relevant 'package.nix' files.
|
||||||
|
# ---
|
||||||
|
# The logic is borrowed from drupol/pkgs-by-name-for-flake-parts, available
|
||||||
|
# under the MIT license.
|
||||||
|
flattenPkgs = separator: path: value:
|
||||||
|
if isDerivation value
|
||||||
|
then {
|
||||||
|
${concatStringsSep separator path} = value;
|
||||||
|
}
|
||||||
|
else if isAttrs value
|
||||||
|
then concatMapAttrs (name: flattenPkgs separator (path ++ [name])) value
|
||||||
|
else
|
||||||
|
# Ignore the functions which makeScope returns
|
||||||
|
{};
|
||||||
|
|
||||||
scopeFromDirectory = directory:
|
inputsScope = makeScope pkgs.newScope (_: {
|
||||||
packagesFromDirectoryRecursive {
|
inherit inputs;
|
||||||
inherit directory;
|
inherit (self) pins;
|
||||||
inherit (inputsScope) newScope callPackage;
|
});
|
||||||
|
|
||||||
|
scopeFromDirectory = directory:
|
||||||
|
packagesFromDirectoryRecursive {
|
||||||
|
inherit directory;
|
||||||
|
inherit (inputsScope) newScope callPackage;
|
||||||
|
};
|
||||||
|
|
||||||
|
legacyPackages = scopeFromDirectory ./pkgs/by-name;
|
||||||
|
in
|
||||||
|
(flattenPkgs "/" [] legacyPackages)
|
||||||
|
// {
|
||||||
|
inherit (docs.manual) htmlOpenTool;
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
docs = docs.manual.html;
|
||||||
|
docs-html = docs.manual.html;
|
||||||
|
docs-manpages = docs.manPages;
|
||||||
|
docs-json = docs.options.json;
|
||||||
|
docs-linkcheck = let
|
||||||
|
site = self.packages.${system}.docs;
|
||||||
|
in
|
||||||
|
pkgs.testers.lycheeLinkCheck {
|
||||||
|
inherit site;
|
||||||
|
|
||||||
|
remap = {
|
||||||
|
"https://notashelf.github.io/nvf/" = "${site}/share/doc/";
|
||||||
|
"https://nvf.notashelf.dev/" = "${site}/share/doc/";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
exclude = [
|
||||||
|
# This is not an email, but just part of an SCM query inside a nix code block.
|
||||||
|
# The leading escaped non breaking space is there on purpose.
|
||||||
|
"%C2%A0@injection.content"
|
||||||
|
];
|
||||||
|
include_mail = true;
|
||||||
|
include_verbatim = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
legacyPackages = scopeFromDirectory ./pkgs/by-name;
|
# Helper utility for building the HTML manual and opening it in the
|
||||||
in {
|
# browser with $BROWSER or using xdg-open as a fallback tool.
|
||||||
packages =
|
# Adapted from Home-Manager, available under the MIT license.
|
||||||
(flattenPkgs "/" [] legacyPackages)
|
docs-html-wrapped = let
|
||||||
// {
|
xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open";
|
||||||
inherit (docs.manual) htmlOpenTool;
|
docs-html = docs.manual.html + /share/doc/nvf;
|
||||||
|
in
|
||||||
|
pkgs.writeShellScriptBin "docs-html-wrapped" ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
# Documentation
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
docs = docs.manual.html;
|
for candidate in xdg-open open w3m; do
|
||||||
docs-html = docs.manual.html;
|
BROWSER="$(type -P $candidate || true)"
|
||||||
docs-manpages = docs.manPages;
|
if [[ -x $BROWSER ]]; then
|
||||||
docs-json = docs.options.json;
|
break;
|
||||||
docs-linkcheck = let
|
|
||||||
site = config.packages.docs;
|
|
||||||
in
|
|
||||||
pkgs.testers.lycheeLinkCheck {
|
|
||||||
inherit site;
|
|
||||||
|
|
||||||
remap = {
|
|
||||||
"https://notashelf.github.io/nvf/" = "${site}/share/doc/";
|
|
||||||
"https://nvf.notashelf.dev/" = "${site}/share/doc/";
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = {
|
|
||||||
exclude = [
|
|
||||||
# This is not an email, but just part of an SCM query inside a nix code block.
|
|
||||||
# The leading escaped non breaking space is there on purpose.
|
|
||||||
"%C2%A0@injection.content"
|
|
||||||
];
|
|
||||||
include_mail = true;
|
|
||||||
include_verbatim = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Helper utility for building the HTML manual and opening it in the
|
|
||||||
# browser with $BROWSER or using xdg-open as a fallback tool.
|
|
||||||
# Adapted from Home-Manager, available under the MIT license.
|
|
||||||
docs-html-wrapped = let
|
|
||||||
xdg-open = lib.getExe' pkgs.xdg-utils "xdg-open";
|
|
||||||
docs-html = docs.manual.html + /share/doc/nvf;
|
|
||||||
in
|
|
||||||
pkgs.writeShellScriptBin "docs-html-wrapped" ''
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
|
||||||
for candidate in xdg-open open w3m; do
|
|
||||||
BROWSER="$(type -P $candidate || true)"
|
|
||||||
if [[ -x $BROWSER ]]; then
|
|
||||||
break;
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
if [[ ! -v BROWSER || -z $BROWSER ]]; then
|
||||||
echo "$0: unable to start a web browser; please set \$BROWSER"
|
echo "$0: unable to start a web browser; please set \$BROWSER"
|
||||||
echo "$0: Trying xdg-open as a fallback"
|
echo "$0: Trying xdg-open as a fallback"
|
||||||
${xdg-open} ${docs-html}/index.xhtml
|
${xdg-open} ${docs-html}/index.xhtml
|
||||||
else
|
else
|
||||||
echo "\$BROWSER is set. Attempting to open manual"
|
echo "\$BROWSER is set. Attempting to open manual"
|
||||||
exec "$BROWSER" "${docs-html}/index.xhtml"
|
exec "$BROWSER" "${docs-html}/index.xhtml"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# 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,17 +1,15 @@
|
||||||
{
|
{
|
||||||
flake.templates = {
|
standalone = {
|
||||||
standalone = {
|
path = ./standalone;
|
||||||
path = ./standalone;
|
description = "Standalone flake template for nvf";
|
||||||
description = "Standalone flake template for nvf";
|
welcomeText = ''
|
||||||
welcomeText = ''
|
Template flake.nix has been created in flake.nix!
|
||||||
Template flake.nix has been created in flake.nix!
|
|
||||||
|
|
||||||
Note that this is a very basic example to bootstrap nvf for you. Please edit your
|
Note that this is a very basic example to bootstrap nvf for you. Please edit your
|
||||||
configuration as described in the nvf manual before using this template. The
|
configuration as described in the nvf manual before using this template. The
|
||||||
configured packages will be ran with 'nix run .' or 'nix run .#neovimConfigured'
|
configured packages will be ran with 'nix run .' or 'nix run .#neovimConfigured'
|
||||||
|
|
||||||
Happy editing!
|
Happy editing!
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue