Compare commits
2 Commits
fax-machin
...
8af3c9fa85
Author | SHA1 | Date | |
---|---|---|---|
8af3c9fa85 | |||
ddedaad4f3 |
@@ -5,7 +5,7 @@
|
||||
tags = {
|
||||
glom = [ "vega" ];
|
||||
b4l = [ "rigel" ];
|
||||
fax-bridge = [ ];
|
||||
fax-bridge = [ "neptune" ];
|
||||
};
|
||||
|
||||
instances = {
|
||||
@@ -57,13 +57,6 @@
|
||||
roles.default.tags."fax-bridge" = { };
|
||||
};
|
||||
|
||||
asterisk = {
|
||||
module = {
|
||||
name = "asterisk";
|
||||
input = "self";
|
||||
};
|
||||
};
|
||||
|
||||
pocket-id = {
|
||||
module = {
|
||||
name = "pocket-id";
|
||||
|
22
machines/neptune/configuration.nix
Normal file
22
machines/neptune/configuration.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ inputs, config, ... }:
|
||||
{
|
||||
imports = [
|
||||
(inputs.import-tree ./services)
|
||||
];
|
||||
nixpkgs.hostPlatform = {
|
||||
system = "x86_64-linux";
|
||||
};
|
||||
boot.loader.grub.devices = [ "/dev/disk/by-id/FIXME" ];
|
||||
fileSystems = {
|
||||
"/".device = "/dev/FIXME";
|
||||
};
|
||||
networking.fqdn = "b4l.co.th";
|
||||
system.stateVersion = "25.11";
|
||||
clan.core.sops.defaultGroups = [ "admins" ];
|
||||
|
||||
security.acme.defaults.email = "admin@b4l.co.th";
|
||||
security.acme.acceptTerms = true;
|
||||
services.nginx.virtualHosts."${config.networking.fqdn}" = {
|
||||
enableACME = true;
|
||||
};
|
||||
}
|
@@ -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")
|
||||
|
||||
'';
|
||||
}
|
@@ -22,7 +22,6 @@
|
||||
yggdrasil-ip = {
|
||||
secret = false;
|
||||
};
|
||||
yggdrasil-subnet.secret = false;
|
||||
};
|
||||
runtimeInputs = with pkgs; [
|
||||
yggdrasil
|
||||
@@ -31,7 +30,6 @@
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user