Unverified Commit 2812d586 authored by numinit's avatar numinit Committed by GitHub
Browse files

nebula-lighthouse-service: init at 2.0.0 (#454855)

parents fdd50d55 9f316d88
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3498,6 +3498,12 @@
    githubId = 37768199;
    name = "Christian Bergschneider";
  };
  bloominstrong = {
    email = "github@mail.bloominstrong.net";
    github = "bloominstrong";
    githubId = 114744388;
    name = "bloominstrong";
  };
  bloveless = {
    email = "brennon.loveless@gmail.com";
    github = "bloveless";
+2 −0
Original line number Diff line number Diff line
@@ -128,6 +128,8 @@

- [dwl](https://codeberg.org/dwl/dwl), a compact, hackable compositor for Wayland based on wlroots. Available as [programs.dwl](#opt-programs.dwl.enable).

- [nebula-lighthouse-service](https://github.com/manuels/nebula-lighthouse-service), a public Nebula VPN lighthouse service. Available as [services.nebula-lighthouse-service](#opt-services.nebula-lighthouse-service.enable).

- [angrr](https://github.com/linyinfeng/angrr), a service that automatically cleans up old auto GC roots. Available as [services.angrr](#opt-services.angrr.enable).

- [Sharkey](https://joinsharkey.org), a Sharkish microblogging platform. Available as [services.sharkey](#opt-services.sharkey.enable).
+1 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,7 @@
  ./services/networking/ncdns.nix
  ./services/networking/ncps.nix
  ./services/networking/ndppd.nix
  ./services/networking/nebula-lighthouse-service.nix
  ./services/networking/nebula.nix
  ./services/networking/netbird.nix
  ./services/networking/netbird/server.nix
+77 −0
Original line number Diff line number Diff line
{
  config,
  pkgs,
  lib,
  ...
}:

let
  inherit (lib) types;

  cfg = config.services.nebula-lighthouse-service;
  settingsFormat = pkgs.formats.yaml { };
in
{

  options.services.nebula-lighthouse-service = {
    enable = lib.mkEnableOption "nebula-lighthouse-service";
    user = lib.mkOption {
      type = types.str;
      default = "nebula-lighthouse";
      description = ''
        The user and group to run nebula-lighthouse-service as.
      '';
      example = "nebula-lighthouse";
    };
    settings = lib.mkOption {
      type = settingsFormat.type;
      default = { };
      description = ''
        Configuration for nebula-lighthouse-service.
      '';
      example = {
        max-port = 65535;
        min-port = 49152;
        "webserver.ip" = "127.0.0.1";
        "webserver.port" = 8080;
      };
    };
  };

  config = lib.mkIf cfg.enable {
    services.nebula-lighthouse-service.settings = {
      min-port = lib.mkDefault 49152;
      max-port = lib.mkDefault 65535;
      "webserver.port" = lib.mkDefault 8080;
      "webserver.ip" = lib.mkDefault "127.0.0.1";
    };
    environment.etc."nebula-lighthouse-service/config.yaml".source =
      settingsFormat.generate "nebula-lighthouse-service-config.yaml" cfg.settings;
    systemd.services.nebula-lighthouse-service = {
      description = "Run nebula-lighthouse-service";
      wants = [ "basic.target" ];
      after = [
        "basic.target"
        "network.target"
      ];
      wantedBy = [ "multi-user.target" ];
      serviceConfig = {
        Type = "exec";
        Restart = "always";
        ExecStart = "${pkgs.nebula-lighthouse-service}/bin/nebula-lighthouse-service";
        StateDirectory = "nebula-lighthouse-service";
        User = cfg.user;
        Group = cfg.user;
      };
    };
    users.users.${cfg.user} = {
      group = cfg.user;
      description = "nebula-lighthouse-service user";
      isSystemUser = true;
    };
    users.groups.${cfg.user} = { };
  };
  meta.maintainers = with lib.maintainers; [
    bloominstrong
  ];
}
+1 −0
Original line number Diff line number Diff line
@@ -1011,6 +1011,7 @@ in
    defaults.services.ncps.cache.dataPath = "/path/to/ncps";
  };
  ndppd = runTest ./ndppd.nix;
  nebula-lighthouse-service = runTest ./nebula-lighthouse-service.nix;
  nebula.connectivity = runTest ./nebula/connectivity.nix;
  nebula.reload = runTest ./nebula/reload.nix;
  neo4j = runTest ./neo4j.nix;
Loading