Skip to content

Commit

Permalink
Merge pull request #42 from jghauser/flake_installable
Browse files Browse the repository at this point in the history
Add flake overlay
  • Loading branch information
jghauser authored May 30, 2024
2 parents 78dad93 + 91ea0a1 commit af6ef55
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 10 deletions.
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ Note that fiddling with the plugin's options can leave the database in a messy s

## Installation

Note that papis.nvim is only tested with the latest stable version of Neovim. It should work across various OSs, but most development has been done on Linux (do feel free to open issues if you run into trouble on non-Linux systems). An installation of Papis is required.

### Package managers

With packer:

```lua
Expand Down Expand Up @@ -106,13 +110,41 @@ With lazy.nvim:

Additional dependencies:

- *papis*: papis.nvim is meant to be used in conjunction with papis and won't run if it doesn't find the `papis` executable. You'll need at least v0.13.
- *yq*: papis.nvim requires the [yq](https://github.com/mikefarah/yq) utility to convert `.yaml` files to `.json` (which can then be read by neovim). Note that papis.nvim doesn't (currently) support the [python yq](https://github.com/kislyuk/yq).
- *treesitter yaml parser*: Required by the completion module.

*Neovim version*: papis.nvim is being tested on the latest stable version.
### Nix

The `flake.nix` provides an overlay that can be used to install `papis.nvim`. With `home-manager`, this can be achieved with something along the following lines:

*Operating system*: papis.nvim has only been tested on Linux -- but will hopefully also work on other operating systems (if you run into problems, please open an issue).
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
papis-nvim.url = "github:jghauser/papis.nvim";
};
outputs = { self, nixpkgs, home-manager, neorg, ... }: {
nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [ papis-nvim.overlays.default ];
home-manager.users.myuser = {
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
papis-nvim
]
};
};
}
];
};
};
}
```

## Setup

Expand Down
50 changes: 44 additions & 6 deletions doc/papis.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*papis.txt* For NVIM v0.8.0 Last change: 2024 March 18
*papis.txt* For NVIM v0.8.0 Last change: 2024 May 30

==============================================================================
Table of Contents *papis-table-of-contents*
Expand All @@ -14,6 +14,7 @@ Table of Contents *papis-table-of-contents*
- Issues/Troubleshooting |papis-📚-papis.nvim-issues/troubleshooting|
- Contributing |papis-📚-papis.nvim-contributing|
- Planned features and improvements|papis-📚-papis.nvim-planned-features-and-improvements|
2. Links |papis-links|

==============================================================================
1. 📚 papis.nvim *papis-📚-papis.nvim*
Expand Down Expand Up @@ -117,6 +118,14 @@ the database.

INSTALLATION *papis-📚-papis.nvim-installation*

Note that papis.nvim is only tested with the latest stable version of Neovim.
It should work across various OSs, but most development has been done on Linux
(do feel free to open issues if you run into trouble on non-Linux systems). An
installation of Papis is required.


PACKAGE MANAGERS ~

With packer:

>lua
Expand Down Expand Up @@ -158,15 +167,44 @@ With lazy.nvim:

Additional dependencies:

- _papis_: papis.nvim is meant to be used in conjunction with papis and won’t run if it doesn’t find the `papis` executable. You’ll need at least v0.13.
- _yq_: papis.nvim requires the yq <https://github.com/mikefarah/yq> utility to convert `.yaml` files to `.json` (which can then be read by neovim). Note that papis.nvim doesn’t (currently) support the python yq <https://github.com/kislyuk/yq>.
- _treesitter yaml parser_: Required by the completion module.

_Neovim version_: papis.nvim is being tested on the latest stable version.

_Operating system_: papis.nvim has only been tested on Linux – but will
hopefully also work on other operating systems (if you run into problems,
please open an issue).
NIX ~

The `flake.nix` provides an overlay that can be used to install `papis.nvim`.
With `home-manager`, this can be achieved with something along the following
lines:

>nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
home-manager.url = "github:nix-community/home-manager";
papis-nvim.url = "github:jghauser/papis.nvim";
};
outputs = { self, nixpkgs, home-manager, neorg, ... }: {
nixosConfigurations.machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [ papis-nvim.overlays.default ];
home-manager.users.myuser = {
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
papis-nvim
]
};
};
}
];
};
};
}
<


SETUP *papis-📚-papis.nvim-setup*
Expand Down
24 changes: 23 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
};

outputs = {nixpkgs, ...}: let
outputs = {
self,
nixpkgs,
...
}: let
systems = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = f:
builtins.listToAttrs (map (name: {
Expand All @@ -14,6 +18,24 @@
})
systems);
in {
overlays.default = final: prev: {
vimPlugins = prev.vimPlugins.extend (f: p: {
papis-nvim = final.vimUtils.buildVimPlugin {
pname = "papis.nvim";
version = toString (self.shortRev or self.dirtyShortRev or self.lastModified or "unknown");
src = self;
dependencies = [
f.telescope-nvim
f.sqlite-lua
f.plenary-nvim
f.nui-nvim
f.nvim-treesitter
f.nvim-treesitter-grammar-yaml
final.yq-go
];
};
});
};
devShells =
forAllSystems
(system: let
Expand Down

0 comments on commit af6ef55

Please sign in to comment.