initial commit
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s

This commit is contained in:
sid 2026-02-23 20:34:35 +01:00
commit 95a533c876
451 changed files with 18255 additions and 0 deletions

View file

@ -0,0 +1,28 @@
{
inputs,
outputs,
pkgs,
...
}:
{
imports = [
inputs.synix.homeModules.common
inputs.synix.homeModules.hyprland
inputs.synix.homeModules.nixvim
inputs.synix.homeModules.stylix
];
home.username = "test-user";
programs.nixvim.enable = true;
wayland.windowManager.hyprland = {
enable = true;
autostart = true;
};
stylix.enable = true;
home.stateVersion = "25.11";
}

View file

@ -0,0 +1,7 @@
{
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -0,0 +1,20 @@
{
inputs,
outputs,
...
}:
{
imports = [
./boot.nix
./hardware.nix
./networking.nix
./users.nix
inputs.synix.nixosModules.common
inputs.synix.nixosModules.device.laptop
inputs.synix.nixosModules.hyprland
];
system.stateVersion = "25.11";
}

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"nvme"
"sd_mod"
"sdhci_pci"
"sr_mod"
"usb_storage"
"virtio_pci"
"virtio_scsi"
"xhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,4 @@
{
networking.hostName = "test-host";
networking.domain = "test-host.local";
}

View file

@ -0,0 +1,13 @@
{ inputs, ... }:
{
imports = [
inputs.synix.nixosModules.normalUsers
];
normalUsers.test-user = {
extraGroups = [
"wheel"
];
};
}

View file

@ -0,0 +1,7 @@
{
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 10;
};
boot.loader.efi.canTouchEfiVariables = true;
}

View file

@ -0,0 +1,20 @@
{
inputs,
outputs,
...
}:
{
imports = [
./boot.nix
./hardware.nix
./networking.nix
./services
./users.nix
inputs.synix.nixosModules.common
inputs.synix.nixosModules.device.server
];
system.stateVersion = "25.11";
}

View file

@ -0,0 +1,48 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [
"ahci"
"nvme"
"sd_mod"
"sdhci_pci"
"sr_mod"
"usb_storage"
"virtio_pci"
"virtio_scsi"
"xhci_pci"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "ext4";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
options = [
"fmask=0022"
"dmask=0022"
];
};
swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -0,0 +1,4 @@
{
networking.hostName = "test-host";
networking.domain = "test-host.local";
}

View file

@ -0,0 +1,6 @@
{
imports = [
./nginx.nix
./openssh.nix
];
}

View file

@ -0,0 +1,14 @@
{
inputs,
...
}:
{
imports = [ inputs.synix.nixosModules.nginx ];
services.nginx = {
enable = true;
forceSSL = true;
openFirewall = true;
};
}

View file

@ -0,0 +1,12 @@
{
inputs,
...
}:
{
imports = [
inputs.synix.nixosModules.openssh
];
services.openssh.enable = true;
}

View file

@ -0,0 +1,13 @@
{ inputs, ... }:
{
imports = [
inputs.synix.nixosModules.normalUsers
];
normalUsers.test-user = {
extraGroups = [
"wheel"
];
};
}

95
tests/run/synapse.nix Normal file
View file

@ -0,0 +1,95 @@
{
name = "synapse-test";
nodes.machine =
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.matrix-synapse;
keyFile = pkgs.writeText "livekit.key" "API Secret: secret";
in
{
# fake sops module
options.sops = lib.mkOption {
type = lib.types.attrs;
default = { };
};
imports = [
../../modules/nixos/matrix-synapse
../../modules/nixos/coturn
../../modules/nixos/maubot
];
config = {
services.matrix-synapse = {
enable = true;
coturn.enable = true;
settings = {
registration_shared_secret = "secret";
turn_shared_secret = "turn-secret";
};
};
services.coturn = {
enable = true;
no-tls = true;
static-auth-secret = "turn-secret";
};
services.maubot = {
enable = true;
extraConfigFile = builtins.toString (
pkgs.writeText "maubot-extra" ''
homeservers:
${cfg.settings.server_name}:
url: http://127.0.0.1:${builtins.toString cfg.port}
secret: ${cfg.settings.registration_shared_secret}
admins:
alice: password
''
);
};
services.livekit.keyFile = keyFile;
services.lk-jwt-service.keyFile = keyFile;
services.nginx.enable = true;
networking.domain = "example.com";
networking.firewall.enable = false; # simplify networking for test
# Override SSL/ACME requirements for test
services.nginx.virtualHosts."example.com".forceSSL = lib.mkForce false;
services.nginx.virtualHosts."example.com".enableACME = lib.mkForce false;
};
};
testScript = ''
start_all()
machine.wait_for_unit("default.target")
machine.wait_for_unit("matrix-synapse.service")
machine.wait_for_open_port(8008)
machine.wait_for_unit("livekit.service")
machine.wait_for_open_port(7880)
machine.wait_for_unit("lk-jwt-service.service")
machine.wait_for_open_port(8080)
machine.wait_for_unit("coturn.service")
machine.wait_for_open_port(3478)
machine.wait_for_unit("maubot.service")
machine.wait_for_open_port(29316)
machine.succeed("curl -f http://localhost:8008/_matrix/client/versions")
# machine.succeed("curl -f http://localhost:29316/_matrix/maubot/v1/logs") # TODO: add auth
'';
}