migrate ergochat module to clanservice
This commit is contained in:
51
checks/ergochat/default.nix
Normal file
51
checks/ergochat/default.nix
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
nixosLib,
|
||||||
|
clan-core,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
nixosLib.runTest (
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
clan-core.modules.nixosVmTest.clanTest
|
||||||
|
];
|
||||||
|
|
||||||
|
hostPkgs = pkgs;
|
||||||
|
name = "ergochat";
|
||||||
|
|
||||||
|
clan = {
|
||||||
|
directory = ./.;
|
||||||
|
modules."@clan/ergochat" = ../../clanServices/ergochat/default.nix;
|
||||||
|
inventory = {
|
||||||
|
machines.server = { };
|
||||||
|
|
||||||
|
instances = {
|
||||||
|
ergochat-test = {
|
||||||
|
module.name = "@clan/ergochat";
|
||||||
|
roles.default.machines."server".settings = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
server = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
testScript = ''
|
||||||
|
start_all()
|
||||||
|
|
||||||
|
server.wait_for_unit("ergochat")
|
||||||
|
|
||||||
|
# Check that ergochat is running
|
||||||
|
server.succeed("systemctl status ergochat")
|
||||||
|
|
||||||
|
# Check that the data directory exists
|
||||||
|
server.succeed("test -d /var/lib/ergo")
|
||||||
|
|
||||||
|
# Check that the server is listening on the correct ports
|
||||||
|
server.succeed("${pkgs.netcat}/bin/nc -z -v ::1 6667")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
)
|
||||||
4
checks/ergochat/sops/users/admin/key.json
Normal file
4
checks/ergochat/sops/users/admin/key.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"publickey": "age1qm0p4vf9jvcnn43s6l4prk8zn6cx0ep9gzvevxecv729xz540v8qa742eg",
|
||||||
|
"type": "age"
|
||||||
|
}
|
||||||
@@ -41,6 +41,9 @@ in
|
|||||||
# Deltachat test
|
# Deltachat test
|
||||||
deltachat = import ./deltachat nixosTestArgs;
|
deltachat = import ./deltachat nixosTestArgs;
|
||||||
|
|
||||||
|
# Ergochat test
|
||||||
|
ergochat = import ./ergochat nixosTestArgs;
|
||||||
|
|
||||||
# Base Tests
|
# Base Tests
|
||||||
secrets = self.clanLib.test.baseTest ./secrets nixosTestArgs;
|
secrets = self.clanLib.test.baseTest ./secrets nixosTestArgs;
|
||||||
borgbackup-legacy = self.clanLib.test.baseTest ./borgbackup-legacy nixosTestArgs;
|
borgbackup-legacy = self.clanLib.test.baseTest ./borgbackup-legacy nixosTestArgs;
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
---
|
---
|
||||||
description = "A modern IRC server"
|
description = "A modern IRC server"
|
||||||
|
categories = ["Social"]
|
||||||
|
features = [ "inventory", "deprecated" ]
|
||||||
---
|
---
|
||||||
|
|||||||
36
clanServices/ergochat/default.nix
Normal file
36
clanServices/ergochat/default.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
_class = "clan.service";
|
||||||
|
manifest.name = "clan-core/ergochat";
|
||||||
|
manifest.description = "A modern IRC server";
|
||||||
|
manifest.categories = [ "Social" ];
|
||||||
|
|
||||||
|
roles.default = {
|
||||||
|
interface =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
options = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
perInstance =
|
||||||
|
{ settings, ... }:
|
||||||
|
{
|
||||||
|
nixosModule =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.ergochat = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
datastore = {
|
||||||
|
autoupgrade = true;
|
||||||
|
path = "/var/lib/ergo/ircd.db";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
clan.core.state.ergochat.folders = [ "/var/lib/ergo" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
6
clanServices/ergochat/flake-module.nix
Normal file
6
clanServices/ergochat/flake-module.nix
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
clan.modules = {
|
||||||
|
ergochat = lib.modules.importApply ./default.nix { };
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./admin/flake-module.nix
|
./admin/flake-module.nix
|
||||||
./deltachat/flake-module.nix
|
./deltachat/flake-module.nix
|
||||||
|
./ergochat/flake-module.nix
|
||||||
./auto-upgrade/flake-module.nix
|
./auto-upgrade/flake-module.nix
|
||||||
./hello-world/flake-module.nix
|
./hello-world/flake-module.nix
|
||||||
./wifi/flake-module.nix
|
./wifi/flake-module.nix
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ nav:
|
|||||||
- reference/clanServices/auto-upgrade.md
|
- reference/clanServices/auto-upgrade.md
|
||||||
- reference/clanServices/borgbackup.md
|
- reference/clanServices/borgbackup.md
|
||||||
- reference/clanServices/deltachat.md
|
- reference/clanServices/deltachat.md
|
||||||
|
- reference/clanServices/ergochat.md
|
||||||
- reference/clanServices/hello-world.md
|
- reference/clanServices/hello-world.md
|
||||||
- reference/clanServices/wifi.md
|
- reference/clanServices/wifi.md
|
||||||
- Clan Modules:
|
- Clan Modules:
|
||||||
|
|||||||
Reference in New Issue
Block a user