Skip to content

Commit

Permalink
tests: Add a test for the nixos module
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys committed Jan 6, 2024
1 parent 96cdbc8 commit c1a8038
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions flake-modules/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
perSystem = {
pkgs,
config,
system,
makeNixvimWithModuleUnfree,
makeNixvimWithModule,
...
Expand Down Expand Up @@ -39,6 +40,17 @@
nixvim = self;
})
.activationPackage;

nixos =
(import ../tests/modules/nixos.nix {
inherit system;
inherit (inputs) nixpkgs;
nixvim = self;
})
.config
.system
.build
.toplevel;
};
};
}
21 changes: 21 additions & 0 deletions tests/modules/nixos.nix
Original file line number Diff line number Diff line change
@@ -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
];
}

0 comments on commit c1a8038

Please sign in to comment.