diff options
author | Vika <vika@fireburn.ru> | 2023-07-22 13:17:56 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2023-07-22 13:41:09 +0300 |
commit | 50c8f7d8f5f04c717ef4e72d873bf994c03efda0 (patch) | |
tree | 98609e2bdb43823d24ca03b96d9c37d2ec34ad02 /distributed-test.nix | |
parent | 827aa789dab67eba2d117298cac60f3f1ea2c7e4 (diff) | |
download | kittybox-50c8f7d8f5f04c717ef4e72d873bf994c03efda0.tar.zst |
Move NixOS tests to a separate folder to prevent clutter
Diffstat (limited to 'distributed-test.nix')
-rw-r--r-- | distributed-test.nix | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/distributed-test.nix b/distributed-test.nix deleted file mode 100644 index 11c2dba..0000000 --- a/distributed-test.nix +++ /dev/null @@ -1,90 +0,0 @@ -# This doesn't seem to work for some reason. I wonder why. -# The VMs themselves don't want to launch properly. -kittybox: -{ lib, system, ... }: let - kittyboxModule = { config, pkgs, lib, ... }: { - imports = [ kittybox.nixosModules.default commonModule ]; - - services.kittybox = { - enable = true; - backendUri = "file:///srv/kittybox/data"; - blobstoreUri = "file:///srv/kittybox/media"; - }; - - environment.systemPackages = with pkgs; [ xh ]; - - virtualisation.fileSystems."/srv" = { - fsType = "nfs"; - options = [ "vers=4" ]; - device = "primrose:/"; - }; - - systemd.services.kittybox = { - bindsTo = [ "srv.mount" ]; - after = [ "srv.mount" ]; - serviceConfig = { - DynamicUser = lib.mkForce false; - User = "kittybox"; - Group = "kittybox"; - }; - }; - }; - commonModule = { - users.users.kittybox = { - isSystemUser = true; - uid = 990; - group = "kittybox"; - }; - users.groups.kittybox.gid = 990; - networking.firewall.enable = false; - }; -in { - name = "kittybox-distributed"; - - nodes = { - primrose = { config, pkgs, lib, ... }: { - imports = [ commonModule ]; - services.nfs.server.enable = true; - services.nfs.server.createMountPoints = true; - services.nfs.server.exports = '' - /srv 192.168.1.0/255.255.255.0(rw,no_root_squash,no_subtree_check,fsid=0) - ''; - systemd.tmpfiles.rules = [ - "d /srv/kittybox 1750 kittybox root -" - "d /srv/kittybox/data 1750 kittybox root -" - "d /srv/kittybox/media 1750 kittybox root -" - ]; - }; - longiflorum = { config, pkgs, lib, ... }: { - imports = [ kittyboxModule ]; - }; - amaranthus = { config, pkgs, lib, ... }: { - imports = [ kittyboxModule ]; - }; - hydrangea = { config, pkgs, lib, ... }: { - imports = [ kittyboxModule ]; - }; - }; - - testScript = '' - primary = primrose; - servants = [longiflorum, amaranthus, hydrangea]; - - primary.wait_for_unit("nfs-server") - primary.succeed("systemctl start network-online.target") - primary.wait_for_unit("network-online.target") - - start_all() - - for machine in servants: - machine.wait_for_open_port(8080) - - # Onboarding - servants[0].copy_from_host("${./onboarding.json}", "/root/onboarding.json") - servants[0].succeed("xh --follow http://localhost:8080/.kittybox/onboarding -j @/root/onboarding.json") - - # Check that all machines got this address onboarded - for machine in servants: - machine.succeed("xh http://localhost:8080/ | grep 'vestige of the past long gone'") - ''; -} |