PunktfunkPunktfunk

NixOS

Install the Punktfunk host on NixOS from the repo's flake — add the binary cache, import the module, enable the host.

Install the host on NixOS 24.11 or newer, x86_64-linux, from the repo's flake and NixOS module. The guided installer doesn't cover NixOS.

1. Add the binary cache

nix.settings = {
  substituters = [ "https://nix.unom.io" ];
  trusted-public-keys = [ "punktfunk-cache-1:yhOJmHxzg6tzXpxSFzlYn6Pc6r0jHprsWqt8MZC654o=" ];
};

The host, the client and the patched gamescope build against your system's nixpkgs, so they can load its GPU driver. The cache holds them only for punktfunk's own nixpkgs; on any other, each update compiles them, which can take an hour or more. To take them from the cache, let your nixpkgs follow punktfunk's:

inputs.nixpkgs.follows = "punktfunk/nixpkgs";

Your system then runs the nixpkgs punktfunk pins: canary moves it to the newest nixos-unstable each night, stable carries the one from its release.

Don't set inputs.punktfunk.inputs.nixpkgs.follows: the console and runner then miss the cache too (packaging/nix).

2. Import the module and enable the host

# flake input: inputs.punktfunk.url = "git+https://git.unom.io/unom/punktfunk?ref=nix-stable";# then: imports = [ punktfunk.nixosModules.default ]; services.punktfunk.host.enable = true;

?ref=nix-stable follows releases. For canary, built nightly from main, use ?ref=nix-canary (Release Channels). Both move only to a commit the binary cache holds.

A typical host block:

services.punktfunk.host = {
  enable = true;
  users = [ "alice" ];     # joins the input and punktfunk groups
  openFirewall = true;
  desktopSession = true;   # on a machine somebody logs into
  settings = { RUST_LOG = "info"; };   # written to host.env
};

The module sets up the user services, udev rules, kernel modules, firewall and groups, and adds the web console and the plugin runner.

Set desktopSession = true on a machine somebody logs into with Plasma or GNOME: the host then restarts with the desktop, and without it capture fails after the desktop restarts. Leave it off on a headless or gamescope box.

3. Start it

From your desktop session:

systemctl --user enable --now punktfunk-host punktfunk-web

On a box nobody logs into, set autoStart = true and enable lingering for the host user instead.

Next: Quick Start, step 3: open the console and pair a device.

More

  • Every option, GPU driver notes and the headless setup: packaging/nix.
  • Run the host without NixOS (wrapped in nixGL for the GPU drivers): nix run 'git+https://git.unom.io/unom/punktfunk?ref=nix-stable#punktfunk-host' -- serve.
  • Update: nix flake update punktfunk, then sudo nixos-rebuild switch. Remove: Uninstall.

On this page