diff options
| author | Preston Pan <ret2pop@nullring.xyz> | 2026-03-10 20:17:57 -0700 |
|---|---|---|
| committer | Preston Pan <ret2pop@nullring.xyz> | 2026-03-10 20:17:57 -0700 |
| commit | c8d23ac96f8a2204a96ee0abd4bce231c0ef84fd (patch) | |
| tree | eaaa68c8deecf58f2353c96a925fa5f57ea6a2c9 | |
| parent | 72d9b0f77016ff0058a2bda873c7bd71caa8649e (diff) | |
maybe test works?
| -rw-r--r-- | config/nix.org | 4 | ||||
| -rw-r--r-- | flake.nix | 41 | ||||
| m--------- | nix | 0 |
3 files changed, 45 insertions, 0 deletions
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; }; @@ -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 -Subproject 44521f898a8e71361e81d42adca748964a457f3 +Subproject 2cae1e9468fcead554f54672fc2250ec31769f1 |
