diff --git a/machines/canopus/configuration.nix b/machines/canopus/configuration.nix index c680ddf..e8bfed4 100644 --- a/machines/canopus/configuration.nix +++ b/machines/canopus/configuration.nix @@ -6,6 +6,7 @@ }: let sitename = "glomerp.newedge.house"; + nbClientName = "netbird-b4l"; in { imports = [ inputs.frappix.nixosModules.x86_64-linux.frappix ]; @@ -36,6 +37,44 @@ in ''; }; + clan.core.vars.generators.netbird = { + files = { + setupKey = { + secret = true; + owner = config.services.netbird.clients.${nbClientName}.user.name; + group = config.services.netbird.clients.${nbClientName}.user.group; + }; + managementURL.secret = false; + }; + + prompts = { + setupKey = { + type = "line"; + persist = true; + description = "Setup Key to connect to the server"; + }; + }; + + script = '' + cat $prompts/setupKey > $out/setupKey + ''; + }; + + services.netbird.enable = true; + services.netbird.clients.${nbClientName} = { + port = 51820; + config = { + ManagementURL = { + "Scheme" = "https"; + "Host" = "netbird.b4l.co.th:443"; + }; + }; + login = { + enable = true; + setupKeyFile = config.clan.core.vars.generators.netbird.files.setupKey.path; + }; + }; + services.frappe = { enable = true; project = "glomerp";