This NixOS module provides two things:
- packaged playit-agent
- a service definition to run
playit-agentas systemd service
Example flake.nix:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
playit-nixos-module.url = "github:pedorich-n/playit-nixos-module";
}
output = { nixpkgs, playit-nixos-module }: {
nixosConfigurations = {
example = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
playit-nixos-module.nixosModules.default
./configuration.nix
];
};
};
}
}Setup service:
{ config, ... }: {
services.playit = {
enable = true;
user = "playit";
group = "playit";
secretPath = config.age.secrets.playit-secret.path;
};
}You can configure the port mappings in the Tunnels section of the website.
Run
nix run github:pedorich-n/playit-nixos-module#playit-cli -- startThe program will prompt the link to the website to claim the agent. Follow the instructions on the website.
After the agent is claimed it will start running and serving the tunnels. You can exit the program at this point.
The TOML file containing the secret for newly claimed agent should be at ~/.config/playit_gg/playit.toml. This file needs to be passed as secretPath.
It is recommended to use secret manager like agenix or sops to avoid having exposed secret in /nix/store
To see latest documentation run
nix run github:pedorich-n/playit-nixos-module#docs.serve