Compare commits
13 Commits
fax-machin
...
198c9a8c11
Author | SHA1 | Date | |
---|---|---|---|
198c9a8c11 | |||
c497a1ba86 | |||
43b8bf0ffe | |||
e1114189f2 | |||
ad1c98be75 | |||
da33b3935e | |||
a02f64a615 | |||
2ab9fc4ad8 | |||
16a2fa0526 | |||
b8dc4757ed | |||
79fa8eef01 | |||
ac731c2f38 | |||
c9f23f4c0a |
@@ -5,6 +5,7 @@
|
|||||||
tags = {
|
tags = {
|
||||||
glom = [ "vega" ];
|
glom = [ "vega" ];
|
||||||
b4l = [ "rigel" ];
|
b4l = [ "rigel" ];
|
||||||
|
|
||||||
fax-bridge = [ ];
|
fax-bridge = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -55,13 +56,7 @@
|
|||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.tags."fax-bridge" = { };
|
roles.default.tags."fax-bridge" = { };
|
||||||
};
|
roles.default.machines."b4l" = { };
|
||||||
|
|
||||||
asterisk = {
|
|
||||||
module = {
|
|
||||||
name = "asterisk";
|
|
||||||
input = "self";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pocket-id = {
|
pocket-id = {
|
||||||
@@ -69,63 +64,55 @@
|
|||||||
name = "pocket-id";
|
name = "pocket-id";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
roles.default.machines."b4l" = { };
|
||||||
};
|
};
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
module = {
|
module = {
|
||||||
name = "nextcloud";
|
name = "nextcloud";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
stirling-pdf = {
|
stirling-pdf = {
|
||||||
module = {
|
module = {
|
||||||
name = "stirling-pdf";
|
name = "stirling-pdf";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
actual-budget = {
|
actual-budget = {
|
||||||
module = {
|
module = {
|
||||||
name = "actual-budget";
|
name = "actual-budget";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
victoriametrics = {
|
victoriametrics = {
|
||||||
module = {
|
module = {
|
||||||
name = "victoriametrics";
|
name = "victoriametrics";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
vikunja = {
|
vikunja = {
|
||||||
module = {
|
module = {
|
||||||
name = "vikunja";
|
name = "vikunja";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
grafana = {
|
grafana = {
|
||||||
module = {
|
module = {
|
||||||
name = "grafana";
|
name = "grafana";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
pingvin = {
|
pingvin = {
|
||||||
module = {
|
module = {
|
||||||
name = "pingvin";
|
name = "pingvin";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
paperless = {
|
paperless = {
|
||||||
module = {
|
module = {
|
||||||
name = "paperless";
|
name = "paperless";
|
||||||
input = "self";
|
input = "self";
|
||||||
};
|
};
|
||||||
roles.default.machines.b4l = { };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{ inputs, config, ... }:
|
{ inputs, config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(inputs.import-tree ./services)
|
# (inputs.import-tree ./services)
|
||||||
];
|
];
|
||||||
nixpkgs.hostPlatform = {
|
nixpkgs.hostPlatform = {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
@@ -1,69 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
_class = "clan.service";
|
|
||||||
manifest.name = "asterisk";
|
|
||||||
manifest.description = "Asterisk PBX server";
|
|
||||||
manifest.categories = [ "System" ];
|
|
||||||
|
|
||||||
roles.default = {
|
|
||||||
perInstance.nixosModule =
|
|
||||||
{
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
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)
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
{ 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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
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,16 +13,18 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
let
|
||||||
|
user = "yggdrasil";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
clan.core.vars.generators.yggdrasil = {
|
clan.core.vars.generators.yggdrasil = {
|
||||||
files = {
|
files = {
|
||||||
yggdrasil-secret = {
|
yggdrasil-secret = {
|
||||||
secret = true;
|
secret = true;
|
||||||
|
owner = user;
|
||||||
|
group = user;
|
||||||
};
|
};
|
||||||
yggdrasil-ip = {
|
yggdrasil-ip.secret = false;
|
||||||
secret = false;
|
|
||||||
};
|
|
||||||
yggdrasil-subnet.secret = false;
|
|
||||||
};
|
};
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
yggdrasil
|
yggdrasil
|
||||||
@@ -31,13 +33,12 @@
|
|||||||
script = ''
|
script = ''
|
||||||
yggdrasil -genconf -json | jq {PrivateKey} > $out/yggdrasil-secret
|
yggdrasil -genconf -json | jq {PrivateKey} > $out/yggdrasil-secret
|
||||||
cat $out/yggdrasil-secret | yggdrasil -useconf -address | tr -d "\n" > $out/yggdrasil-ip
|
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 = {
|
services.yggdrasil = {
|
||||||
enable = lib.mkDefault true;
|
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 = {
|
settings = {
|
||||||
Peers = [
|
Peers = [
|
||||||
# US Peers
|
# US Peers
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
{
|
{ lib, ... }:
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
self,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
module = lib.modules.importApply ./default.nix { };
|
module = lib.modules.importApply ./default.nix { };
|
||||||
in
|
in
|
||||||
@@ -14,10 +9,10 @@ in
|
|||||||
perSystem =
|
perSystem =
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
# clan.nixosTests.yggdrasil = {
|
clan.nixosTests.yggdrasil = {
|
||||||
# imports = [ ./tests/vm/default.nix ];
|
imports = [ ./tests/vm/default.nix ];
|
||||||
#
|
|
||||||
# clan.modules."@clan/yggdrasil" = module;
|
clan.modules."@clan/yggdrasil" = module;
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -33,5 +34,8 @@
|
|||||||
|
|
||||||
# Check that garage is running
|
# Check that garage is running
|
||||||
server.succeed("systemctl status yggdrasil")
|
server.succeed("systemctl status yggdrasil")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user