nix-community.nixvim/tests/flake.nix
Pedro Alves 4ddd3969e5
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.

The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.

For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
2022-09-18 11:19:23 +01:00

82 lines
2.2 KiB
Nix

{
description = "A set of test configurations for nixvim";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixvim.url = "./..";
outputs = { self, nixvim, nixpkgs, flake-utils, ... }:
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs { inherit system; };
build = nixvim.build pkgs;
in
rec {
# A plain nixvim configuration
packages = {
plain = build { };
# Should print "Hello!" when starting up
hello = build {
extraConfigLua = "print(\"Hello!\")";
};
simple-plugin = build {
extraPlugins = [ pkgs.vimPlugins.vim-surround ];
};
gruvbox = build {
extraPlugins = [ pkgs.vimPlugins.gruvbox ];
colorscheme = "gruvbox";
};
gruvbox-module = build {
colorschemes.gruvbox.enable = true;
};
treesitter = build {
plugins.treesitter.enable = true;
};
treesitter-nonix = build {
plugins.treesitter = {
enable = true;
nixGrammars = false;
};
};
};
})) // {
nixosConfigurations.nixvim-machine = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ pkgs, ... }: {
environment.systemPackages = [
(nixvim.build pkgs { colorschemes.gruvbox.enable = true; })
];
})
];
};
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
({ pkgs, ... }: {
boot.isContainer = true;
# Let 'nixos-version --json' know about the Git revision
# of this flake.
system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
imports = [
nixvim.nixosModules.x86_64-linux.nixvim
];
programs.nixvim = {
enable = true;
colorschemes.gruvbox.enable = true;
};
})
];
};
};
}