start on netbird and dynamicDNS
This commit is contained in:
73
system-config/services/containers/netbird/default.nix
Normal file
73
system-config/services/containers/netbird/default.nix
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
|
options.sysconfig.opts = {
|
||||||
|
|
||||||
|
netbird.enable = lib.options.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualization.netbird = {
|
||||||
|
enable = lib.options.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
|
||||||
|
services.netbird = {
|
||||||
|
enable = config.sysconfig.opts.netbird.enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = lib.mkIf config.sysconfig.opts.netbird.enable [ pkgs.netbird-ui ];
|
||||||
|
|
||||||
|
containers.netbird = lib.mkIf config.sysconfig.opts.virtualization.netbird.enable {
|
||||||
|
|
||||||
|
autoStart = true;
|
||||||
|
privateNetwork = true;
|
||||||
|
hostAddress = "192.168.100.10";
|
||||||
|
localAddress = "192.168.100.21";
|
||||||
|
|
||||||
|
bindMounts = {};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
|
||||||
|
services.netbird = {
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
server = {
|
||||||
|
|
||||||
|
enable = true;
|
||||||
|
domain = "vpn.blunkall.us";
|
||||||
|
|
||||||
|
management = {
|
||||||
|
enable = true;
|
||||||
|
#dnsDomain = ".vpn";
|
||||||
|
|
||||||
|
enableNginx = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
dashboard = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
enableNginx = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
coturn = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
signal = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
enableNginx = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
40
system-config/services/dynamicDNS/default.nix
Normal file
40
system-config/services/dynamicDNS/default.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
|
options.sysconfig.opts.dynamicDNS.enable = lib.options.mkOption {
|
||||||
|
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.sysconfig.opts.dynamicDNS {
|
||||||
|
|
||||||
|
systemd.timers.dynamicDNS = {
|
||||||
|
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
|
||||||
|
timerConfig = {
|
||||||
|
|
||||||
|
OnBootSec = "5m";
|
||||||
|
|
||||||
|
OnUnitActiveSec = "1h";
|
||||||
|
|
||||||
|
Unit = "dynamicDNS.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.dynamicDNS = {
|
||||||
|
|
||||||
|
name = "dynamicDNS.service";
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
|
||||||
|
Type = "oneshot";
|
||||||
|
|
||||||
|
LoadCredential = [ "cloudflare-api-key" ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
script = '''';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user