My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/test/nixos-functions/default.nix

43 lines
1.1 KiB

/*
This file is a test that makes sure that the `pkgs.nixos` and
`pkgs.nixosTest` functions work. It's far from a perfect test suite,
but better than not checking them at all on hydra.
To run this test:
nixpkgs$ nix-build -A tests.nixos-functions
*/
{ pkgs, lib, stdenv, ... }:
let
dummyVersioning = {
revision = "test";
versionSuffix = "test";
label = "test";
};
in lib.optionalAttrs stdenv.hostPlatform.isLinux (
pkgs.recurseIntoAttrs {
nixos-test = (pkgs.nixos {
system.nixos = dummyVersioning;
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/null";
system.stateVersion = lib.trivial.release;
}).toplevel;
nixosTest-test = pkgs.nixosTest ({ lib, pkgs, figlet, ... }: {
name = "nixosTest-test";
nodes.machine = { pkgs, ... }: {
system.nixos = dummyVersioning;
environment.systemPackages = [ pkgs.hello figlet ];
system.stateVersion = lib.trivial.release;
};
testScript = ''
machine.succeed("hello | figlet >/dev/console")
'';
});
}
)