How to add a nixvim flake like a module in my nixos config #560
-
|
Hi, thanks for your work. inputs.nixvim.url = "github:nix-community/nixvim";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {
self,
nixpkgs,
nixvim,
flake-utils,
}: let
pkgs = nixpkgs.legacyPackages."x86_64-linux";
config = {
colorschemes.kanagawa = {
enable = true;
terminalColors = false;
commentStyle = {italic = false;};
keywordStyle = {italic = false;};
};
plugins.lualine = {
enable = true;
refresh.statusline = 0;
componentSeparators = {
left = "";
right = "";
};
sectionSeparators = {
left = "";
right = "";
};
sections = {
lualine_b = [{name = "diagnostics";}];
lualine_c = [
{
name = "filename";
}
];
lualine_x = [{name = "filetype";}];
};
};
in
flake-utils.lib.eachDefaultSystem (system: let
nixvim' = nixvim.legacyPackages."x86_64-linux";
nvim = nixvim'.makeNixvim config;
in {
packages = {
inherit nvim;
default = nvim;
};
});I added input nixvim in my nixos config flake: nixvim = {
url = "github:repo/my-nixvim-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ {
self,
nixpkgs,
home-manager,
nixvim,
...
}: {How to add a module in my config to replace pkgs.neovim with pkgs.nixvim ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Ok, so if I understand correctly, you have a standalone flake for your nixvim configuration. Now what you want to do is to use this resulting package in your configuration (home-manager or NixOS) right ? |
Beta Was this translation helpful? Give feedback.
-
|
It works perfectly. Thank you very much. home-manager.users.yourname.home.packages = [
inputs.nixvim.packages."${system}".nvim
]; |
Beta Was this translation helpful? Give feedback.
Ok, so if I understand correctly, you have a standalone flake for your nixvim configuration.
Running
nix runin this repo runs your customized neovim.Now what you want to do is to use this resulting package in your configuration (home-manager or NixOS) right ?
If the system configuration also lives as a flake output, then, add your nixvim flake as input.
Then, add
inputs.nixvim.packages."${system}".nvimto yoursystemPackagesorhome.packageslist.