You can try out my configuration by running the following command in your shell:
nix run github:alcestide/nixvim
Alternatively, you could:
git clone https://github.com/alcestide/nixvim
and then run nix run .
inside the cloned directory.
To make this configuration persistent, you can either use flakes (easier) or the standalone method. Here’s how:
- In your flake.nix, create inside
inputs
:
nixvim = {
url = "github:alcestide/nixvim";
};
Then simply add it to your packages like this:
inputs.nixvim.packages."x86_64-linux".default
- Create a variable for your Nixvim config directory (I put mine inside the same directory of
configuration.nix
). - Create another variable and assign to it
nixvim.legacyPackages."${pkgs.stdenv.hostPlatform.system}"
(in this case the variable is named "alknix", but you can call it as you like). - Pass the Nixvim config as a module to the
makeNixvimWithModule
function as shown below:
let
nixvim-config = import ./nixvim/config;
alknixvim = nixvim.legacyPackages.x86_64-linux.makeNixvimWithModule {
inherit pkgs;
module = nixvim-config;};
in
Add the newly created package to your systemPackages
list:
environment.systemPackages = [
alknixvim
];
Finally, rebuild your NixOS configuration by running:
sudo nixos-rebuild switch
This should set everything up.
If you encounter issues:
- Check for version mismatches between
nixvim
andnixpkgs
inside yourflake.nix
. Make sure they're both the same version! - Review the logs for any errors that might indicate what’s going wrong.