From c8d23ac96f8a2204a96ee0abd4bce231c0ef84fd Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 10 Mar 2026 20:17:57 -0700 Subject: maybe test works? --- config/nix.org | 4 ++++ flake.nix | 41 +++++++++++++++++++++++++++++++++++++++++ nix | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/config/nix.org b/config/nix.org index dc2c823..1939a28 100644 --- a/config/nix.org +++ b/config/nix.org @@ -308,6 +308,10 @@ and now for the main flake: }; in { + lib = { + inherit mkHostModules; + }; + checks."${system}" = integrationTests // { inherit pre-commit-check; }; diff --git a/flake.nix b/flake.nix index ad7a690..09c8ea9 100644 --- a/flake.nix +++ b/flake.nix @@ -66,6 +66,15 @@ src = ./.; hooks = { deadnix.enable = true; + test-spontaneity-vm-with-site = { + enable = true; + name = "spontaneity-vm"; + description = "test boot the spontaneity vm to check nginx config. Required test as we inject monorepoSelf variable."; + stages = [ "pre-merge-commit" ]; + entry = "${pkgs.writeShellScript "website-check" '' +nix build .#spontaneity +''}"; + }; website-build-check = { enable = true; name = "website-build"; @@ -318,6 +327,38 @@ sha256sum installer.iso > installer.iso.sha256 checks."${system}" = { build-website = website; + spontaneity-website-test = pkgs.testers.runNixOSTest { + name = "spontaneity-website-test"; + + node.specialArgs = { + monorepoSelf = self; + isIntegrationTest = true; + }; + + nodes."spontaneity" = { lib, ... }: { + imports = nixmacs.lib.mkHostModules "spontaneity" ++ [ + "${nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix" + { + nixpkgs.pkgs = lib.mkVMOverride self.nixosConfigurations.spontaneity.pkgs; + nixpkgs.config = lib.mkForce {}; + systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false; + systemd.services.NetworkManager-wait-online.enable = lib.mkForce false; + nixpkgs.overlays = lib.mkForce []; + } + ]; + disabledModules = [ + "${nixmacs}/systems/spontaneity/hardware-configuration.nix" + ]; + }; + + testScript = '' +spontaneity.start() +spontaneity.wait_for_unit("nginx.service") +spontaneity.wait_for_open_port(443) +spontaneity.succeed("systemctl is-active nginx") +spontaneity.succeed("echo 'smoke'") + ''; + }; }; packages."${system}" = { diff --git a/nix b/nix index 44521f8..2cae1e9 160000 --- a/nix +++ b/nix @@ -1 +1 @@ -Subproject commit 44521f898a8e71361e81d42adca748964a457f31 +Subproject commit 2cae1e9468fcead554f54672fc2250ec31769f1f -- cgit v1.3