mirror of
https://github.com/dali99/nixos-matrix-modules.git
synced 2024-12-22 02:47:29 +01:00
WIP: create tests
This commit is contained in:
parent
f5bb4ac8c2
commit
f3fcbc2b40
16
flake.lock
generated
16
flake.lock
generated
@ -1,5 +1,20 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1690789960,
|
||||
"narHash": "sha256-3K+2HuyGTiJUSZNJxXXvc0qj4xFx1FHC/ItYtEa7/Xs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fb942492b7accdee4e6d17f5447091c65897dde4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"lastModified": 1673743903,
|
||||
@ -17,6 +32,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
}
|
||||
}
|
||||
|
18
flake.nix
18
flake.nix
@ -2,13 +2,27 @@
|
||||
description = "NixOS modules for matrix related services";
|
||||
|
||||
inputs = {
|
||||
nixpkgs-lib.url = github:nix-community/nixpkgs.lib;
|
||||
nixpkgs-lib.url = "github:nix-community/nixpkgs.lib";
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs-lib }: {
|
||||
outputs = { self, nixpkgs, nixpkgs-lib }: {
|
||||
nixosModules = {
|
||||
default = import ./module.nix;
|
||||
};
|
||||
|
||||
lib = import ./lib.nix { lib = nixpkgs-lib.lib; };
|
||||
|
||||
packages = let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
${system}.tests = import ./tests {
|
||||
inherit system;
|
||||
inherit nixpkgs;
|
||||
inherit pkgs;
|
||||
nixosModule = self.outputs.nixosModules.synapse;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
18
tests/auto-workers-config.nix
Normal file
18
tests/auto-workers-config.nix
Normal file
@ -0,0 +1,18 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.matrix-synapse-next = {
|
||||
enable = true;
|
||||
settings.server_name = "matrix.example.com";
|
||||
|
||||
workers = {
|
||||
enableMetrics = true;
|
||||
|
||||
federationSenders = 2;
|
||||
federationReceivers = 2;
|
||||
initialSyncers = 2;
|
||||
normalSyncers = 2;
|
||||
eventPersisters = 2;
|
||||
useUserDirectoryWorker = true;
|
||||
};
|
||||
};
|
||||
}
|
7
tests/base-config.nix
Normal file
7
tests/base-config.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
services.matrix-synapse-next = {
|
||||
enable = true;
|
||||
settings.server_name = "matrix.example.com";
|
||||
};
|
||||
}
|
16
tests/default.nix
Normal file
16
tests/default.nix
Normal file
@ -0,0 +1,16 @@
|
||||
{ nixpkgs, pkgs, system ? pkgs.system, nixosModule, ... }: let
|
||||
buildSystemWithConfig = configPath: (nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
nixosModule
|
||||
configPath
|
||||
{
|
||||
boot.isContainer = true;
|
||||
}
|
||||
];
|
||||
}).config.system.build.toplevel;
|
||||
in {
|
||||
a = pkgs.writeText "hello-world" ''a'';
|
||||
base-config = buildSystemWithConfig ./base-config.nix;
|
||||
auto-workers-config = buildSystemWithConfig ./auto-workers-config.nix;
|
||||
}
|
Loading…
Reference in New Issue
Block a user