mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
tests: Add a test for the nixos module (#907)
This commit is contained in:
parent
7582a6e413
commit
245930d735
2 changed files with 64 additions and 29 deletions
|
@ -6,39 +6,53 @@
|
|||
perSystem = {
|
||||
pkgs,
|
||||
config,
|
||||
system,
|
||||
makeNixvimWithModuleUnfree,
|
||||
makeNixvimWithModule,
|
||||
...
|
||||
}: {
|
||||
checks = {
|
||||
tests = import ../tests {
|
||||
inherit pkgs;
|
||||
inherit (pkgs) lib;
|
||||
makeNixvim = configuration:
|
||||
makeNixvimWithModuleUnfree {
|
||||
module = {
|
||||
config = configuration;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extra-args-tests = import ../tests/extra-args.nix {
|
||||
inherit pkgs;
|
||||
inherit makeNixvimWithModule;
|
||||
};
|
||||
|
||||
lib-tests = import ../tests/lib-tests.nix {
|
||||
inherit pkgs;
|
||||
inherit (pkgs) lib;
|
||||
};
|
||||
|
||||
home-manager =
|
||||
(import ../tests/modules/hm.nix {
|
||||
checks =
|
||||
{
|
||||
tests = import ../tests {
|
||||
inherit pkgs;
|
||||
inherit (inputs) home-manager;
|
||||
nixvim = self;
|
||||
})
|
||||
.activationPackage;
|
||||
};
|
||||
inherit (pkgs) lib;
|
||||
makeNixvim = configuration:
|
||||
makeNixvimWithModuleUnfree {
|
||||
module = {
|
||||
config = configuration;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extra-args-tests = import ../tests/extra-args.nix {
|
||||
inherit pkgs;
|
||||
inherit makeNixvimWithModule;
|
||||
};
|
||||
|
||||
lib-tests = import ../tests/lib-tests.nix {
|
||||
inherit pkgs;
|
||||
inherit (pkgs) lib;
|
||||
};
|
||||
|
||||
home-manager-module =
|
||||
(import ../tests/modules/hm.nix {
|
||||
inherit pkgs;
|
||||
inherit (inputs) home-manager;
|
||||
nixvim = self;
|
||||
})
|
||||
.activationPackage;
|
||||
}
|
||||
// pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
|
||||
nixos-module =
|
||||
(import ../tests/modules/nixos.nix {
|
||||
inherit system;
|
||||
inherit (inputs) nixpkgs;
|
||||
nixvim = self;
|
||||
})
|
||||
.config
|
||||
.system
|
||||
.build
|
||||
.toplevel;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
21
tests/modules/nixos.nix
Normal file
21
tests/modules/nixos.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
nixvim,
|
||||
nixpkgs,
|
||||
system,
|
||||
}:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
{
|
||||
system.stateVersion = "23.11";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
fileSystems."/" = {device = "/non/existent/device";};
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
nixvim.nixosModules.nixvim
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue