mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-13 07:31:02 +00:00
357 lines
82 KiB
HTML
357 lines
82 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Introduction</title>
|
|
|
|
<script>
|
|
// Apply sidebar state immediately to prevent flash
|
|
(function () {
|
|
if (localStorage.getItem("sidebar-collapsed") === "true") {
|
|
document.documentElement.classList.add("sidebar-collapsed");
|
|
}
|
|
})();
|
|
</script>
|
|
<link rel="stylesheet" href="assets/style.css" />
|
|
<script defer src="assets/main.js"></script>
|
|
|
|
<script>
|
|
window.searchNamespace = window.searchNamespace || {};
|
|
window.searchNamespace.rootPath = "";
|
|
</script>
|
|
<script defer src="assets/search.js"></script>
|
|
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<header>
|
|
<div class="header-left">
|
|
<h1 class="site-title">
|
|
<a href="index.html">NVF</a>
|
|
</h1>
|
|
|
|
<nav class="header-nav">
|
|
<ul>
|
|
<li >
|
|
<a href="options.html">Options</a>
|
|
</li>
|
|
|
|
<li><a href="search.html">Search</a></li>
|
|
|
|
</ul>
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
<div class="search-container">
|
|
<input type="text" id="search-input" placeholder="Search..." />
|
|
<div id="search-results" class="search-results"></div>
|
|
</div>
|
|
|
|
</header>
|
|
|
|
<div class="layout">
|
|
<div class="sidebar-toggle" aria-label="Toggle sidebar">
|
|
<svg
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
height="24"
|
|
>
|
|
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path>
|
|
</svg>
|
|
</div>
|
|
<nav class="sidebar">
|
|
<div class="docs-nav">
|
|
<h2>Documents</h2>
|
|
<ul>
|
|
<li><a href="index.html">Introduction</a></li>
|
|
<li><a href="configuring.html">Configuring nvf</a></li>
|
|
<li><a href="hacking.html">Hacking nvf</a></li>
|
|
<li><a href="tips.html">Helpful Tips</a></li>
|
|
<li><a href="quirks.html">Known Issues and Quirks</a></li>
|
|
<li><a href="release-notes.html">Release Notes</a></li>
|
|
<li><a href="search.html">Search</a></li>
|
|
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="toc">
|
|
<h2>Contents</h2>
|
|
<ul class="toc-list">
|
|
<li><a href="#nvf-manual">Introduction</a>
|
|
<ul><li><a href="#ch-preface">Preface</a>
|
|
<ul><li><a href="#sec-what-is-it">What is nvf</a>
|
|
</ul><li><a href="#ch-try-it-out">Try it out</a>
|
|
<li><a href="#sec-using-prebuilt-configs">Using Prebuilt Configs</a>
|
|
<ul><li><a href="#sec-available-configs">Available Configurations</a>
|
|
</ul><li><a href="#ch-installation">Installing nvf</a>
|
|
</ul><li><a href="#ch-standalone-installation">Standalone Installation</a>
|
|
<li><a href="#ch-standalone-nixos">Standalone Installation on NixOS</a>
|
|
<li><a href="#ch-standalone-hm">Standalone Installation on Home-Manager</a>
|
|
<li><a href="#ch-module-installation">Module Installation</a>
|
|
<li><a href="#ch-nixos-module">NixOS Module</a>
|
|
<ul><li><a href="#sec-nixos-flakes">With Flakes</a>
|
|
<ul><li><a href="#sec-flakes-prerequisites">Prerequisites</a>
|
|
<li><a href="#sec-nixos-flakes-usage">Usage</a>
|
|
<li><a href="#sec-example-installation-nixos">Example Installation</a>
|
|
</ul><li><a href="#sec-nixos-flakeless">Without Flakes</a>
|
|
<li><a href="#sec-hm-flakes">With Flakes</a>
|
|
<ul><li><a href="#sec-flakes-prerequisites">Prerequisites</a>
|
|
<li><a href="#sec-hm-flakes-usage">Usage</a>
|
|
<li><a href="#sec-example-installation-hm">Example Installation</a>
|
|
</ul><li><a href="#sec-hm-flakeless">Without Flakes</a>
|
|
</li></ul></li>
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="content"><html><head></head><body><h1 id="nvf-manual">Introduction</h1>
|
|
<p>Version v0.9</p>
|
|
<h2 id="ch-preface">Preface</h2>
|
|
<h3 id="sec-what-is-it">What is nvf</h3>
|
|
<p><strong>nvf</strong> is a highly modular, configurable, extensible and easy to use Neovim
|
|
configuration framework built and designed to be used with Nix. Boasting
|
|
flexibility, robustness and ease of use, this projecct allows you to configure a
|
|
fully featured Neovim instance with a few lines of Nix with lots of options for
|
|
advanced users as well.</p>
|
|
<h2 id="ch-try-it-out">Try it out</h2>
|
|
<p>Thanks to the portability of Nix, you can try out nvf without actually
|
|
installing it to your machine. Below are the commands you may run to try out
|
|
different configurations provided by this flake. As of v0.5, two specialized
|
|
configurations are provided:</p>
|
|
<ul>
|
|
<li><strong>Nix</strong> (<code>packages.nix</code>) - Nix language server + simple utility plugins</li>
|
|
<li><strong>Maximal</strong> (<code>packages.maximal</code>) - Variable language servers + utility and
|
|
decorative plugins</li>
|
|
</ul>
|
|
<p>You may try out any of the provided configurations using the <code>nix run</code> command
|
|
on a system where Nix is installed.</p>
|
|
<pre class="highlight"><code class="language-sh"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">cachix</span> <span style="color:rgb(232,102,113);">use</span> <span style="color:rgb(232,102,113);">nvf</span> <span style="color:rgb(92,99,112);font-style: italic;"># Optional: it'll save you CPU resources and time</span><br><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">run</span> <span style="color:rgb(232,102,113);">github:notashelf/nvf#nix</span> <span style="color:rgb(92,99,112);font-style: italic;"># Will run the default minimal configuration</span><br></code></pre>
|
|
<p>Do keep in mind that this is <strong>susceptible to garbage collection</strong> meaning that
|
|
the built outputs will be removed from your Nix store once you garbage collect.</p>
|
|
<h2 id="sec-using-prebuilt-configs">Using Prebuilt Configs</h2>
|
|
<pre class="highlight"><code class="language-bash"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">run</span> <span style="color:rgb(232,102,113);">github:notashelf/nvf#nix</span><br><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">run</span> <span style="color:rgb(232,102,113);">github:notashelf/nvf#maximal</span><br></code></pre>
|
|
<h3 id="sec-available-configs">Available Configurations</h3>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p>The below configurations are provided for demonstration purposes, and are
|
|
<strong>not</strong> designed to be installed as is. You may refer to the installation
|
|
steps below and the helpful tips section for details on creating your own
|
|
configurations.</p>
|
|
</div>
|
|
<h4 id="sec-configs-nix">Nix</h4>
|
|
<p><code>Nix</code> configuration by default provides LSP/diagnostic support for Nix alongside
|
|
a set of visual and functional plugins. By running <code>nix run .#</code>, which is the
|
|
default package, you will build Neovim with this config.</p>
|
|
<pre class="highlight"><code class="language-bash"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">run</span> <span style="color:rgb(232,102,113);">github:notashelf/nvf#nix</span> <span style="color:rgb(232,102,113);">test.nix</span><br><span style="color:rgb(92,99,112);font-style: italic;"># => This will open a file called `test.nix` with Nix LSP and syntax highlighting</span><br></code></pre>
|
|
<p>This command will start Neovim with some opinionated plugin configurations, and
|
|
is designed specifically for Nix. the <code>nix</code> configuration lets you see how a
|
|
fully configured Neovim setup <em>might</em> look like without downloading too many
|
|
packages or shell utilities.</p>
|
|
<h4 id="sec-configs-maximal">Maximal</h4>
|
|
<p><code>Maximal</code> is the ultimate configuration that will enable support for more
|
|
commonly used language as well as additional complementary plugins. Keep in
|
|
mind, however, that this will pull a lot of dependencies.</p>
|
|
<pre class="highlight"><code class="language-bash"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">run</span> <span style="color:rgb(232,102,113);">github:notashelf/nvf#maximal</span> <span style="color:rgb(232,102,113);">--</span> <span style="color:rgb(232,102,113);">test.nix</span><br><span style="color:rgb(92,99,112);font-style: italic;"># => This will open a file called `test.nix` with a variety of plugins available</span><br></code></pre>
|
|
<p>It uses the same configuration template with the <a href="#sec-configs-nix">Nix</a>
|
|
configuration, but supports many more languages, and enables more utility,
|
|
companion or fun plugins.</p>
|
|
<div class="admonition warning">
|
|
<p class="admonition-title">Warning</p>
|
|
<p>Running the maximal config will download <em>a lot</em> of packages as it is
|
|
downloading language servers, formatters, and more. If CPU time and bandwidth
|
|
are concerns, please use the default package instead.</p>
|
|
</div>
|
|
<h2 id="ch-installation">Installing nvf</h2>
|
|
<p>There are multiple ways of installing nvf on your system. You may either choose
|
|
the standalone installation method, which does not depend on a module system and
|
|
may be done on any system that has the Nix package manager or the appropriate
|
|
modules for NixOS and home-manager as described in the
|
|
<a href="#ch-module-installation">module installation section</a>.</p>
|
|
<h1 id="ch-standalone-installation">Standalone Installation</h1>
|
|
<p>It is possible to install nvf without depending on NixOS or Home-Manager as the
|
|
parent module system, using the <code>neovimConfiguration</code> function exposed in the
|
|
extended library. This function will take <code>modules</code> and <code>extraSpecialArgs</code> as
|
|
arguments, and return the following schema as a result.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">options</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">The options that were available to configure</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">config</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">The outputted configuration</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">pkgs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">The package set used to evaluate the module</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">neovim</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">The built neovim package</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<p>An example flake that exposes your custom Neovim configuration might look like</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NixOS/nixpkgs/nixos-unstable</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:notashelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(97,175,239);">outputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><span style="color:rgb(232,102,113);">nixpkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span><span style="color:rgb(132,139,152);">}</span> <span style="color:rgb(171,178,191);">@</span> <span style="color:rgb(232,102,113);">inputs</span><span style="color:rgb(232,102,113);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">packages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">x86_64-linux</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Set the default package to the wrapped instance of Neovim.</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># This will allow running your Neovim configuration with</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># `nix run` and in addition, sharing your configuration with</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># other users in case your repository is public.</span><br> <span style="color:rgb(86,182,194);">default</span> <span style="color:rgb(171,178,191);">=</span><br> <span style="color:rgb(132,139,152);">(</span><span style="color:rgb(171,178,191);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">neovimConfiguration</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">pkgs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">legacyPackages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">x86_64-linux</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">config</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">vim</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Enable custom theming options</span><br> <span style="color:rgb(86,182,194);">theme</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Enable Treesitter</span><br> <span style="color:rgb(86,182,194);">treesitter</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Other options will go here. Refer to the config</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># reference in Appendix B of the nvf manual.</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">)</span><br> <span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">neovim</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
|
|
<p>The above setup will allow to set up nvf as a standalone flake, which you can
|
|
build independently from your system configuration while also possibly sharing
|
|
it with others. The next two chapters will detail specific usage of such a setup
|
|
for a package output in the context of NixOS or Home-Manager installation.</p>
|
|
<h1 id="ch-standalone-nixos">Standalone Installation on NixOS</h1>
|
|
<p>Your built Neovim configuration can be exposed as a flake output to make it
|
|
easier to share across machines, repositories and so on. Or it can be added to
|
|
your system packages to make it available across your system.</p>
|
|
<p>The following is an example installation of <code>nvf</code> as a standalone package with
|
|
the default theme enabled. You may use other options inside <code>config.vim</code> in
|
|
<code>configModule</code>, but this example will not cover that extensively.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NixOS/nixpkgs/nixos-unstable</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">home-manager</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:nix-community/home-manager</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:notashelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(97,175,239);">outputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(232,102,113);">nixpkgs</span><span style="color:rgb(132,139,152);">,</span><br> <span style="color:rgb(232,102,113);">nvf</span><span style="color:rgb(132,139,152);">,</span><br> <span style="color:rgb(232,102,113);">self</span><span style="color:rgb(132,139,152);">,</span><br> <span style="color:rgb(232,102,113);">...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># This will make the package available as a flake output under 'packages'</span><br> <span style="color:rgb(86,182,194);">packages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">x86_64-linux</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">my-neovim</span> <span style="color:rgb(171,178,191);">=</span><br> <span style="color:rgb(132,139,152);">(</span><span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">neovimConfiguration</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">pkgs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">legacyPackages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">x86_64-linux</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Or move this to a separate file and add it's path here instead</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># IE: ./nvf_module.nix</span><br> <span style="color:rgb(132,139,152);">(</span><br> <span style="color:rgb(132,139,152);">{</span><span style="color:rgb(232,102,113);">pkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span><span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Add any custom options (and do feel free to upstream them!)</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># options = { ... };</span><br> <span style="color:rgb(86,182,194);">config</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">vim</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">theme</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># and more options as you see fit...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><br> <span style="color:rgb(132,139,152);">)</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">)</span><br> <span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">neovim</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Example nixosConfiguration using the configured Neovim package</span><br> <span style="color:rgb(86,182,194);">nixosConfigurations</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">yourHostName</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">nixosSystem</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># This will make wrapped neovim available in your system packages</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Can also move this to another config file if you pass your own</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># inputs/self around with specialArgs</span><br> <span style="color:rgb(132,139,152);">(</span><span style="color:rgb(132,139,152);">{</span><span style="color:rgb(232,102,113);">pkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span><span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">environment</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">systemPackages</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><span style="color:rgb(171,178,191);">self</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">packages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(232,102,113);">${</span><span style="color:rgb(171,178,191);">pkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">stdenv</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">system</span><span style="color:rgb(232,102,113);">}</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">neovim</span><span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">)</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<h1 id="ch-standalone-hm">Standalone Installation on Home-Manager</h1>
|
|
<p>Your built Neovim configuration can be exposed as a flake output to make it
|
|
easier to share across machines, repositories and so on. Or it can be added to
|
|
your system packages to make it available across your system.</p>
|
|
<p>The following is an example installation of <code>nvf</code> as a standalone package with
|
|
the default theme enabled. You may use other options inside <code>config.vim</code> in
|
|
<code>configModule</code>, but this example will not cover that extensively.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NixOS/nixpkgs/nixos-unstable</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">home-manager</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:nix-community/home-manager</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:notashelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(97,175,239);">outputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><span style="color:rgb(232,102,113);">nixpkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">home-manager</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">nvf</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span><span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(198,120,221);">let</span><br> system <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">x86_64-linux</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> pkgs <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">legacyPackages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(232,102,113);">${</span><span style="color:rgb(171,178,191);">system</span><span style="color:rgb(232,102,113);">}</span><span style="color:rgb(132,139,152);">;</span><br> configModule <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Add any custom options (and do feel free to upstream them!)</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># options = { ... };</span><br><br> <span style="color:rgb(86,182,194);">config</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">vim</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">theme</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># and more options as you see fit...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> customNeovim <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">neovimConfiguration</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(198,120,221);">inherit</span> pkgs<span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><span style="color:rgb(171,178,191);">configModule</span><span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(198,120,221);">in</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># This will make the package available as a flake output under 'packages'</span><br> <span style="color:rgb(86,182,194);">packages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(232,102,113);">${</span><span style="color:rgb(171,178,191);">system</span><span style="color:rgb(232,102,113);">}</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">my-neovim</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">customNeovim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">neovim</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Example Home-Manager configuration using the configured Neovim package</span><br> <span style="color:rgb(86,182,194);">homeConfigurations</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">your-username@your-hostname</span><span style="color:rgb(152,195,121);">"</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">home-manager</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">homeManagerConfiguration</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># This will make Neovim available to users using the Home-Manager</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># configuration. To make the package available to all users, prefer</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># environment.systemPackages in your NixOS configuration.</span><br> <span style="color:rgb(132,139,152);">{</span><span style="color:rgb(86,182,194);">home</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">packages</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><span style="color:rgb(171,178,191);">customNeovim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">neovim</span><span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><span style="color:rgb(132,139,152);">}</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<h1 id="ch-module-installation">Module Installation</h1>
|
|
<p>The below chapters will describe installing nvf as NixOS and Home-Manager
|
|
modules. Note that those methods are mutually exclusive, and will likely cause
|
|
path collisions if used simultaneously.</p>
|
|
<h1 id="ch-nixos-module">NixOS Module</h1>
|
|
<p>The NixOS module allows us to customize the different <code>vim</code> options from inside
|
|
the NixOS configuration without having to call for the wrapper yourself. It is
|
|
the recommended way to use <strong>nvf</strong> alongside the home-manager module depending
|
|
on your needs.</p>
|
|
<h2 id="sec-nixos-flakes">With Flakes</h2>
|
|
<h3 id="sec-flakes-prerequisites">Prerequisites</h3>
|
|
<p>To install nvf with flakes, you must make sure the following requirements are
|
|
met.</p>
|
|
<ol>
|
|
<li>Nix 2.4 or later must be installed. You may use <code>nix-shell</code> to get a later
|
|
version of Nix from nixpkgs.</li>
|
|
<li>Flake-related experimental features must be enabled. Namely, you need
|
|
<code>nix-command</code> and <code>flakes</code>. Some Nix vendors enable those by default, please
|
|
consult their documentation if you are not using mainstream Nix.
|
|
<ul>
|
|
<li>
|
|
<p>When using NixOS, add the following to your <code>configuration.nix</code> and rebuild
|
|
your system.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(171,178,191);">nix</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">settings</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">experimental-features</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">nix-command flakes</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br></code></pre>
|
|
</li>
|
|
<li>
|
|
<p>If you are not using NixOS, add the following to <code>nix.conf</code> (located at
|
|
<code>~/.config/nix/</code> or <code>/etc/nix/nix.conf</code>).</p>
|
|
<pre class="highlight"><code class="language-bash"><span style="color:rgb(97,175,239);">experimental-features</span> <span style="color:rgb(232,102,113);">=</span> <span style="color:rgb(232,102,113);">nix-command</span> <span style="color:rgb(232,102,113);">flakes</span><br></code></pre>
|
|
</li>
|
|
<li>
|
|
<p>You may need to restart the Nix daemon with, for example,
|
|
<code>sudo systemctl restart nix-daemon.service</code>.</p>
|
|
</li>
|
|
<li>
|
|
<p>Alternatively, you can enable flakes on a per-command basis with the
|
|
following additional flags to <code>nix</code> and <code>home-manager</code>:</p>
|
|
<pre class="highlight"><code class="language-sh"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">--extra-experimental-features</span> <span style="color:rgb(152,195,121);">"nix-command flakes"</span> <span style="color:rgb(171,178,191);"><</span><span style="color:rgb(232,102,113);">sub-commands</span><span style="color:rgb(171,178,191);">></span><br></code></pre>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
<h3 id="sec-nixos-flakes-usage">Usage</h3>
|
|
<p>To use <strong>nvf</strong> with flakes, we first need to add the input to our <code>flake.nix</code>.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(92,99,112);font-style: italic;"># flake.nix</span><br><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optional, if you intend to follow nvf's obsidian-nvim input</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># you must also add it as a flake input.</span><br> <span style="color:rgb(86,182,194);">obsidian-nvim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:epwalsh/obsidian.nvim</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Required, nvf works best and only directly supports flakes</span><br> <span style="color:rgb(86,182,194);">nvf</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NotAShelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># You can override the input nixpkgs to follow your system's</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># instance of nixpkgs. This is safe to do as nvf does not depend</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># on a binary cache.</span><br> <span style="color:rgb(86,182,194);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">follows</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">nixpkgs</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optionally, you can also override individual plugins</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># for example:</span><br> <span style="color:rgb(86,182,194);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">obsidian-nvim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">follows</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">obsidian-nvim</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- this will use the obsidian-nvim from your inputs</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<p>Followed by importing the NixOS module somewhere in your configuration.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># assuming nvf is in your inputs and inputs is in the argset</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># see example below</span><br> <span style="color:rgb(86,182,194);">imports</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span> <span style="color:rgb(171,178,191);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nixosModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">default</span> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<h3 id="sec-example-installation-nixos">Example Installation</h3>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NixOS/nixpkgs/nixos-unstable</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:notashelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(97,175,239);">outputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span> <span style="color:rgb(232,102,113);">nixpkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">nvf</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ↓ this is your host output in the flake schema</span><br> <span style="color:rgb(86,182,194);">nixosConfigurations</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">your-hostname</span><span style="color:rgb(152,195,121);">"</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">nixosSystem</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nixosModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">default</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- this imports the NixOS module that provides the options</span><br> <span style="color:rgb(232,102,113);">./configuration.nix</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- your host entrypoint, `programs.nvf.*` may be defined here</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<p>Once the module is properly imported by your host, you will be able to use the
|
|
<code>programs.nvf</code> module option anywhere in your configuration in order to
|
|
configure <strong>nvf</strong>.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">programs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <br> <span style="color:rgb(92,99,112);font-style: italic;"># Your settings need to go into the settings attribute set</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># most settings are documented in the appendix</span><br> <span style="color:rgb(86,182,194);">settings</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">viAlias</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">false</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">vimAlias</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lsp</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p><strong>nvf</strong> exposes a lot of options, most of which are not referenced in the
|
|
installation sections of the manual. You may find all available options in the
|
|
<a href="https://notashelf.github.io/nvf/options">appendix</a></p>
|
|
</div>
|
|
<h2 id="sec-nixos-flakeless">Without Flakes</h2>
|
|
<p>As of v0.8, it is possible to install <strong>nvf</strong> on a system if you are not using
|
|
flakes. This is possible thanks to the flake-compat project.</p>
|
|
<p>To get started, you must fetch the repository using <code>builtins.fetchTarball</code> or a
|
|
similar mechanism.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(92,99,112);font-style: italic;"># configuration.nix</span><br><span style="color:rgb(198,120,221);">let</span><br> nvf <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(198,120,221);">import</span> <span style="color:rgb(132,139,152);">(</span><span style="color:rgb(209,154,102);">builtins</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">fetchTarball</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">https://github.com/notashelf/nvf/archive/<commit or tag>.tar.gz</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optionally, you can add 'sha256' for verification and caching</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># sha256 = "<sha256>";</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">)</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(198,120,221);">in</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">imports</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Import the NixOS module from your fetched input</span><br> <span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nixosModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Once the module is imported, you may use `programs.nvf` as exposed by the</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># NixOS module.</span><br> <span style="color:rgb(86,182,194);">programs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<div class="admonition tip">
|
|
<p class="admonition-title">Tip</p>
|
|
<p>Nix2 does not have a builtin lockfile mechanism like flakes. As such you must
|
|
manually update the URL and hash for your input. This is annoying to deal with,
|
|
and most users choose to defer this task to projects such as <a href="https://github.com/andir/npins">npins</a> or <a href="https://github.com/nmattia/niv">niv</a>.
|
|
If you are new to NixOS, I encourage you to look into Flakes and see if they fit
|
|
your use case. Alternatively, look into the aforementioned projects for more
|
|
convenient dependency management mechanisms.</p>
|
|
</div>
|
|
# Home-Manager Module {#ch-hm-module}
|
|
<p>The home-manager module allows us to customize the different <code>vim</code> options from
|
|
inside the home-manager configuration without having to call for the wrapper
|
|
yourself. It is the recommended way to use <strong>nvf</strong> alongside the NixOS module
|
|
depending on your needs.</p>
|
|
<h2 id="sec-hm-flakes">With Flakes</h2>
|
|
<h3 id="sec-flakes-prerequisites">Prerequisites</h3>
|
|
<p>To install nvf with flakes, you must make sure the following requirements are
|
|
met.</p>
|
|
<ol>
|
|
<li>Nix 2.4 or later must be installed. You may use <code>nix-shell</code> to get a later
|
|
version of Nix from nixpkgs.</li>
|
|
<li>Flake-related experimental features must be enabled. Namely, you need
|
|
<code>nix-command</code> and <code>flakes</code>. Some Nix vendors enable those by default, please
|
|
consult their documentation if you are not using mainstream Nix.
|
|
<ul>
|
|
<li>
|
|
<p>When using NixOS, add the following to your <code>configuration.nix</code> and rebuild
|
|
your system.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(171,178,191);">nix</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">settings</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">experimental-features</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">nix-command flakes</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br></code></pre>
|
|
</li>
|
|
<li>
|
|
<p>If you are not using NixOS, add the following to <code>nix.conf</code> (located at
|
|
<code>~/.config/nix/</code> or <code>/etc/nix/nix.conf</code>).</p>
|
|
<pre class="highlight"><code class="language-bash"><span style="color:rgb(97,175,239);">experimental-features</span> <span style="color:rgb(232,102,113);">=</span> <span style="color:rgb(232,102,113);">nix-command</span> <span style="color:rgb(232,102,113);">flakes</span><br></code></pre>
|
|
</li>
|
|
<li>
|
|
<p>You may need to restart the Nix daemon with, for example,
|
|
<code>sudo systemctl restart nix-daemon.service</code>.</p>
|
|
</li>
|
|
<li>
|
|
<p>Alternatively, you can enable flakes on a per-command basis with the
|
|
following additional flags to <code>nix</code> and <code>home-manager</code>:</p>
|
|
<pre class="highlight"><code class="language-sh"><span style="color:rgb(232,102,113);">$</span> <span style="color:rgb(171,178,191);">nix</span> <span style="color:rgb(232,102,113);">--extra-experimental-features</span> <span style="color:rgb(152,195,121);">"nix-command flakes"</span> <span style="color:rgb(171,178,191);"><</span><span style="color:rgb(232,102,113);">sub-commands</span><span style="color:rgb(171,178,191);">></span><br></code></pre>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
<h3 id="sec-hm-flakes-usage">Usage</h3>
|
|
<p>To use <strong>nvf</strong> with flakes, we first need to add the input to our <code>flake.nix</code>.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(92,99,112);font-style: italic;"># flake.nix</span><br><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optional, if you intend to follow nvf's obsidian-nvim input</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># you must also add it as a flake input.</span><br> <span style="color:rgb(86,182,194);">obsidian-nvim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:epwalsh/obsidian.nvim</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Required, nvf works best and only directly supports flakes</span><br> <span style="color:rgb(86,182,194);">nvf</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NotAShelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># You can override the input nixpkgs to follow your system's</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># instance of nixpkgs. This is safe to do as nvf does not depend</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># on a binary cache.</span><br> <span style="color:rgb(86,182,194);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">follows</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">nixpkgs</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optionally, you can also override individual plugins</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># for example:</span><br> <span style="color:rgb(86,182,194);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">obsidian-nvim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">follows</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">obsidian-nvim</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- this will use the obsidian-nvim from your inputs</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># ...</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<p>Followed by importing the home-manager module somewhere in your configuration.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Assuming "nvf" is in your inputs and inputs is in the argument set.</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># See example installation below</span><br> <span style="color:rgb(86,182,194);">imports</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span> <span style="color:rgb(171,178,191);">inputs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">homeManagerModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">default</span> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<h3 id="sec-example-installation-hm">Example Installation</h3>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">inputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:NixOS/nixpkgs/nixos-unstable</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">home-manager</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:nix-community/home-manager</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">github:notashelf/nvf</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(97,175,239);">outputs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span> <span style="color:rgb(232,102,113);">nixpkgs</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">home-manager</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">nvf</span><span style="color:rgb(132,139,152);">,</span> <span style="color:rgb(232,102,113);">...</span> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">:</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># ↓ this is your home output in the flake schema, expected by home-manager</span><br> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">your-username@your-hostname</span><span style="color:rgb(152,195,121);">"</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">home-manager</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lib</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(97,175,239);">homeManagerConfiguration</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">pkgs</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(171,178,191);">nixpkgs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">legacyPackages</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">x86_64-linux</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">modules</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">homeManagerModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">default</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- this imports the home-manager module that provides the options</span><br> <span style="color:rgb(232,102,113);">./home.nix</span> <span style="color:rgb(92,99,112);font-style: italic;"># <- your home entrypoint, `programs.nvf.*` may be defined here</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<p>Once the module is properly imported by your host, you will be able to use the
|
|
<code>programs.nvf</code> module option anywhere in your configuration in order to
|
|
configure <strong>nvf</strong>.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">programs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># your settings need to go into the settings attribute set</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># most settings are documented in the appendix</span><br> <span style="color:rgb(86,182,194);">settings</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">viAlias</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">false</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">vimAlias</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(86,182,194);">vim</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">lsp</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<div class="admonition note">
|
|
<p class="admonition-title">Note</p>
|
|
<p><strong>nvf</strong> exposes a lot of options, most of which are not referenced in the
|
|
installation sections of the manual. You may find all available options in the
|
|
<a href="https://notashelf.github.io/nvf/options">appendix</a></p>
|
|
</div>
|
|
<h2 id="sec-hm-flakeless">Without Flakes</h2>
|
|
<p>As of v0.8, it is possible to install <strong>nvf</strong> on a system if you are not using
|
|
flakes. This is possible thanks to the flake-compat project.</p>
|
|
<p>To get started, you must fetch the repository using <code>builtins.fetchTarball</code> or a
|
|
similar mechanism.</p>
|
|
<pre class="highlight"><code class="language-nix"><span style="color:rgb(92,99,112);font-style: italic;"># home.nix</span><br><span style="color:rgb(198,120,221);">let</span><br> nvf <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(198,120,221);">import</span> <span style="color:rgb(132,139,152);">(</span><span style="color:rgb(209,154,102);">builtins</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">fetchTarball</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">url</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(152,195,121);">"</span><span style="color:rgb(152,195,121);">https://github.com/notashelf/nvf/archive/<commit or tag>.tar.gz</span><span style="color:rgb(152,195,121);">"</span><span style="color:rgb(132,139,152);">;</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Optionally, you can add 'sha256' for verification and caching</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># sha256 = "<sha256>";</span><br> <span style="color:rgb(132,139,152);">}</span><span style="color:rgb(132,139,152);">)</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(198,120,221);">in</span> <span style="color:rgb(132,139,152);">{</span><br> <span style="color:rgb(86,182,194);">imports</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(132,139,152);">[</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># Import the NixOS module from your fetched input</span><br> <span style="color:rgb(171,178,191);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">homeManagerModules</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><br> <span style="color:rgb(132,139,152);">]</span><span style="color:rgb(132,139,152);">;</span><br><br> <span style="color:rgb(92,99,112);font-style: italic;"># Once the module is imported, you may use `programs.nvf` as exposed by the</span><br> <span style="color:rgb(92,99,112);font-style: italic;"># NixOS module.</span><br> <span style="color:rgb(86,182,194);">programs</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">nvf</span><span style="color:rgb(132,139,152);">.</span><span style="color:rgb(86,182,194);">enable</span> <span style="color:rgb(171,178,191);">=</span> <span style="color:rgb(209,154,102);">true</span><span style="color:rgb(132,139,152);">;</span><br><span style="color:rgb(132,139,152);">}</span><br></code></pre>
|
|
<div class="admonition tip">
|
|
<p class="admonition-title">Tip</p>
|
|
<p>Nix2 does not have a builtin lockfile mechanism like flakes. As such you must
|
|
manually update the URL and hash for your input. This is annoying to deal with,
|
|
and most users choose to defer this task to projects such as <a href="https://github.com/andir/npins">npins</a> or <a href="https://github.com/nmattia/niv">niv</a>.
|
|
If you are new to NixOS, I encourage you to look into Flakes and see if they fit
|
|
your use case. Alternatively, look into the aforementioned projects for more
|
|
convenient dependency management mechanisms.</p>
|
|
</div>
|
|
</body></html><!-- TODO: mention the built-in flake template here when it is added --></main>
|
|
</div>
|
|
|
|
<footer>
|
|
<p>Generated with ndg</p>
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|