Skip to content

ngrok/ngrok-nix

Repository files navigation

ngrok-nix

Run ngrok as a service on your NixOS machine

configuration.nix

When using configuration.nix you can include ngrok service as follows:

{ pkgs, config, ... }:
let
  ngrok = builtins.fetchGit {
    url = "https://github.com/ngrok/ngrok-nix";
    rev = "c56189898f263153a2a16775ea2b871084a4efb0";
  };
in
{
  nixpkgs.config.allowUnfree = true;
  imports = [
    "${ngrok}/nixos.nix"
  ];
  services.ngrok = {
    enable = true;
    extraConfig = { };
    extraConfigFiles = [
      # reference to files containing `authtoken` and `api_key` secrets
      # ngrok will merge these, together with `extraConfig`
    ];
    tunnels = {
      # ...
    };
  };
}

flake.nix

With flakes, things are even easier:

{
  inputs = {
    ngrok.url = "github:ngrok/ngrok-nix";
  };

  outputs = { self, ngrok, ... }@inputs: {
    nixosConfigurations."<YOUR_HOSTNAME>" = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        ngrok.nixosModules.ngrok
        ({ pkgs, ... }: {
          nixpkgs.config.allowUnfree = true;
          services.ngrok = {
            enable = true;
            extraConfig = { };
            extraConfigFiles = [
              # reference to files containing `authtoken` and `api_key` secrets
              # ngrok will merge these, together with `extraConfig`
            ];
            tunnels = {
              # ...
            };
          };
        })
      ];
    };
  };
}

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published