Compare commits
4 Commits
198c9a8c11
...
mob/asteri
Author | SHA1 | Date | |
---|---|---|---|
f8079aaa47 | |||
4704dd43fa | |||
b5f3adacd8 | |||
2eb52251cc |
@@ -5,7 +5,6 @@
|
||||
tags = {
|
||||
glom = [ "vega" ];
|
||||
b4l = [ "rigel" ];
|
||||
|
||||
fax-bridge = [ ];
|
||||
};
|
||||
|
||||
@@ -56,7 +55,6 @@
|
||||
input = "self";
|
||||
};
|
||||
roles.default.tags."fax-bridge" = { };
|
||||
roles.default.machines."b4l" = { };
|
||||
};
|
||||
|
||||
pocket-id = {
|
||||
@@ -64,55 +62,63 @@
|
||||
name = "pocket-id";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines."b4l" = { };
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
nextcloud = {
|
||||
module = {
|
||||
name = "nextcloud";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
stirling-pdf = {
|
||||
module = {
|
||||
name = "stirling-pdf";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
actual-budget = {
|
||||
module = {
|
||||
name = "actual-budget";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
victoriametrics = {
|
||||
module = {
|
||||
name = "victoriametrics";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
vikunja = {
|
||||
module = {
|
||||
name = "vikunja";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
grafana = {
|
||||
module = {
|
||||
name = "grafana";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
pingvin = {
|
||||
module = {
|
||||
name = "pingvin";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
paperless = {
|
||||
module = {
|
||||
name = "paperless";
|
||||
input = "self";
|
||||
};
|
||||
roles.default.machines.b4l = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{ inputs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
# (inputs.import-tree ./services)
|
||||
(inputs.import-tree ./services)
|
||||
];
|
||||
nixpkgs.hostPlatform = {
|
||||
system = "x86_64-linux";
|
||||
|
70
modules/clan/asterisk/default.nix
Normal file
70
modules/clan/asterisk/default.nix
Normal file
@@ -0,0 +1,70 @@
|
||||
{ ... }:
|
||||
{
|
||||
_class = "clan.service";
|
||||
manifest.name = "asterisk";
|
||||
manifest.description = "Asterisk PBX server";
|
||||
manifest.categories = [ "System" ];
|
||||
|
||||
roles.default = {
|
||||
perInstance.nixosModule =
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.asterisk = {
|
||||
enable = lib.mkDefault true;
|
||||
confFiles = {
|
||||
# Dial plan config
|
||||
"extensions.conf" = ''
|
||||
exten => 1001,1,Dial(PJSIP/user1,20)
|
||||
exten => 1002,1,Dial(PJSIP/user2,20)
|
||||
|
||||
exten => 100,1,Answer()
|
||||
same => n,Wait(1)
|
||||
same => n,Playback(hello-world)
|
||||
same => n,Hangup()
|
||||
'';
|
||||
|
||||
"pjsip.conf" = ''
|
||||
[transport-udp]
|
||||
type=transport
|
||||
protocol=udp
|
||||
bind=0.0.0.0,[::]
|
||||
|
||||
[endpoint_internal](!)
|
||||
type=endpoint
|
||||
context=from-internal
|
||||
disallow=all
|
||||
allow=ulaw
|
||||
|
||||
[auth_userpass](!)
|
||||
type=auth
|
||||
auth_type=userpass
|
||||
|
||||
[aor_dynamic](!)
|
||||
type=aor
|
||||
max_contacts=1
|
||||
|
||||
[user1](endpoint_internal)
|
||||
auth=user1
|
||||
aors=user1
|
||||
[user1](auth_userpass)
|
||||
password=user1
|
||||
username=user1
|
||||
[user1](aor_dynamic)
|
||||
|
||||
[user2](endpoint_internal)
|
||||
auth=user2
|
||||
aors=user2
|
||||
[user2](auth_userpass)
|
||||
password=user2
|
||||
username=user2
|
||||
[user2](aor_dynamic)
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
modules/clan/asterisk/flake-module.nix
Normal file
18
modules/clan/asterisk/flake-module.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
module = lib.modules.importApply ./default.nix { };
|
||||
in
|
||||
{
|
||||
clan.modules = {
|
||||
asterisk = module;
|
||||
};
|
||||
perSystem =
|
||||
{ ... }:
|
||||
{
|
||||
clan.nixosTests.asterisk = {
|
||||
imports = [ ./tests/vm/default.nix ];
|
||||
|
||||
clan.modules."@clan/asterisk" = module;
|
||||
};
|
||||
};
|
||||
}
|
39
modules/clan/asterisk/tests/vm/default.nix
Normal file
39
modules/clan/asterisk/tests/vm/default.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
name = "service-asterisk";
|
||||
|
||||
clan = {
|
||||
directory = ./.;
|
||||
inventory = {
|
||||
machines.server = { };
|
||||
|
||||
instances = {
|
||||
asterisk-test = {
|
||||
module.name = "@clan/asterisk";
|
||||
module.input = "self";
|
||||
roles.default.machines."server".settings = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes = {
|
||||
server = {
|
||||
services.asterisk = {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
|
||||
server.wait_for_unit("asterisk")
|
||||
|
||||
# Check that garage is running
|
||||
server.succeed("systemctl status asterisk")
|
||||
|
||||
'';
|
||||
}
|
@@ -13,18 +13,16 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
user = "yggdrasil";
|
||||
in
|
||||
{
|
||||
clan.core.vars.generators.yggdrasil = {
|
||||
files = {
|
||||
yggdrasil-secret = {
|
||||
secret = true;
|
||||
owner = user;
|
||||
group = user;
|
||||
};
|
||||
yggdrasil-ip.secret = false;
|
||||
yggdrasil-ip = {
|
||||
secret = false;
|
||||
};
|
||||
yggdrasil-subnet.secret = false;
|
||||
};
|
||||
runtimeInputs = with pkgs; [
|
||||
yggdrasil
|
||||
@@ -33,12 +31,13 @@
|
||||
script = ''
|
||||
yggdrasil -genconf -json | jq {PrivateKey} > $out/yggdrasil-secret
|
||||
cat $out/yggdrasil-secret | yggdrasil -useconf -address | tr -d "\n" > $out/yggdrasil-ip
|
||||
yggdrasil -useconffile $out/yggdrasil-secret -subnet | tr -d "\n" > $out/yggdrasil-subnet
|
||||
'';
|
||||
};
|
||||
|
||||
services.yggdrasil = {
|
||||
enable = lib.mkDefault true;
|
||||
# configFile = config.clan.core.vars.generators.yggdrasil.files.yggdrasil-secret.path;
|
||||
configFile = config.clan.core.vars.generators.yggdrasil.files.yggdrasil-secret.path;
|
||||
settings = {
|
||||
Peers = [
|
||||
# US Peers
|
||||
|
@@ -1,4 +1,9 @@
|
||||
{ lib, ... }:
|
||||
{
|
||||
lib,
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
}:
|
||||
let
|
||||
module = lib.modules.importApply ./default.nix { };
|
||||
in
|
||||
@@ -9,10 +14,10 @@ in
|
||||
perSystem =
|
||||
{ ... }:
|
||||
{
|
||||
clan.nixosTests.yggdrasil = {
|
||||
imports = [ ./tests/vm/default.nix ];
|
||||
|
||||
clan.modules."@clan/yggdrasil" = module;
|
||||
};
|
||||
# clan.nixosTests.yggdrasil = {
|
||||
# imports = [ ./tests/vm/default.nix ];
|
||||
#
|
||||
# clan.modules."@clan/yggdrasil" = module;
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
@@ -1,5 +1,4 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -34,8 +33,5 @@
|
||||
|
||||
# Check that garage is running
|
||||
server.succeed("systemctl status yggdrasil")
|
||||
|
||||
|
||||
|
||||
'';
|
||||
}
|
||||
|
Reference in New Issue
Block a user