tests: patched nixpkgs no longer needed

This commit is contained in:
Timothy DeHerrera 2021-03-16 15:49:33 -06:00
parent 9537daee32
commit 436fbb08e8
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122

View File

@ -3,40 +3,10 @@ let
inherit (self.inputs) nixos;
inherit (self.nixosConfigurations.NixOS.config.lib) testModule specialArgs;
# current release 20.09 does not support the specialArgs required for us
# to use tests as we would normally use hosts. Using the "testing-python.nix"
# from the override flake would build the test-vm from an unstable os
# different than the one our systems are running. Instead simply patch nixpkgs
# to include the updated version. This can be removed in the next release
patchedNixpkgs =
pkgs.stdenv.mkDerivation {
name = "nixpkgs-patched";
src = nixos;
patches = [ ./0004-nixos-testing-Add-support-for-specialArgs.patch ];
dontBuild = true;
dontFixup = true;
versionSuffix = "pre${
if nixos ? lastModified
then builtins.substring 0 8 (nixos.lastModifiedDate or nixos.lastModified)
else toString nixos.revCount}.${nixos.shortRev or "dirty"}";
configurePhase = ''
echo -n $VERSION_SUFFIX > .version-suffix
echo -n ${nixos.rev or nixos.shortRev or "dirty"} > .git-revision
'';
installPhase = ''
cp -r $PWD $out
'';
};
mkTest =
let
nixosTesting =
(import "${patchedNixpkgs}/nixos/lib/testing-python.nix" {
(import "${nixos}/nixos/lib/testing-python.nix" {
inherit (pkgs.stdenv.hostPlatform) system;
inherit specialArgs;
inherit pkgs;