nixos-module/test-nixos.nix
jade de3c854615 Warn on mismatched Lix module version
Especially with nixpkgs being an extremely uncontrolled variable, we
cannot guarantee that the module is always the right version. This will
cause support burden, so let's automatically diagnose it.
2024-07-30 15:13:24 -07:00

33 lines
958 B
Nix

{ pkgs, nixos, lix-module }:
let
pkgs' = import pkgs.path {
inherit (pkgs) system;
};
configs = {
it-builds = nixos ({ ... }: {
imports = [ lix-module ];
documentation.enable = false;
fileSystems."/".device = "ignore-root-device";
boot.loader.grub.enable = false;
system.stateVersion = "24.05";
});
# Intentionally provoke the wrong major version.
# Does assume that the module is one major ahead of the release; the main
# purpose here is a manual testing fixture.
wrongMajor = pkgs'.nixos ({ ... }: {
imports = [ (import ./module.nix { lix = null; }) ];
documentation.enable = false;
fileSystems."/".device = "ignore-root-device";
boot.loader.grub.enable = false;
system.stateVersion = "24.05";
});
};
in
{
inherit configs;
it-builds = configs.it-builds.config.system.build.toplevel;
wrongMajor = configs.wrongMajor.config.system.build.toplevel;
}