nvf/flake/packages.nix

63 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2023-02-10 17:40:13 +00:00
{inputs, ...}: {
perSystem = {
system,
config,
2023-02-10 17:50:20 +00:00
pkgs,
2023-02-10 17:40:13 +00:00
...
2023-03-31 02:26:46 +00:00
}: let
2024-04-09 07:02:58 +00:00
docs = import ../docs {inherit pkgs inputs;};
2023-03-31 02:26:46 +00:00
in {
packages =
2023-02-10 17:40:13 +00:00
{
# Documentation
docs = docs.manual.html;
docs-html = docs.manual.html;
docs-manpages = docs.manPages;
docs-json = docs.options.json;
2023-10-20 13:28:35 +00:00
# Build and open the built manual in your system browser
2023-10-03 19:08:02 +00:00
docs-html-wrapped = pkgs.writeScriptBin "docs-html-wrapped" ''
#!${pkgs.stdenv.shell}
# use xdg-open to open the docs in the browser
${pkgs.xdg_utils}/bin/xdg-open ${docs.manual.html}
'';
2023-10-20 13:28:35 +00:00
# Exposed neovim configurations
2023-02-10 17:40:13 +00:00
nix = config.legacyPackages.neovim-nix;
maximal = config.legacyPackages.neovim-maximal;
2023-02-15 09:05:18 +00:00
default = config.legacyPackages.neovim-nix;
2023-10-20 13:28:35 +00:00
# Published docker images
2023-10-20 13:28:35 +00:00
docker-nix = let
inherit (pkgs) bash gitFull buildEnv dockerTools;
inherit (config.legacyPackages) neovim-nix;
in
dockerTools.buildImage {
name = "neovim-flake";
2023-10-20 13:28:35 +00:00
tag = "latest";
copyToRoot = buildEnv {
name = "neovim-root";
pathsToLink = ["/bin"];
paths = [
neovim-nix
gitFull
bash
];
};
config = {
Cmd = ["${neovim-nix}/bin/nvim"];
WorkingDir = "/home/neovim/demo";
Volumes = {"/home/neovim/demo" = {};};
};
};
2023-02-10 17:40:13 +00:00
}
// (
if !(builtins.elem system ["aarch64-darwin" "x86_64-darwin"])
then {tidal = config.legacyPackages.neovim-tidal;}
else {}
);
};
}