Flux (phone link)¶
Last Updated: 2026-11-13
Flux connects the desktop session to an Android phone (fluxd, flux-cli, flux-gui and the Omarchy bar plugin) from
the nixarchy-flux flake input. It is enabled on p620 and razer via features.flux in
modules/desktop/flux.nix.
What features.flux enables¶
modules/desktop/flux.nix uses the upstream NixOS + Home Manager hybrid so the daemon and shell plugin live in the user
session while system packages and udev rules are installed at the host level:
- NixOS (
inputs.nixarchy-flux.nixosModules.default): - Installs the
fluxpackages, runtime tools and udev rules (services.flux.enable = true). - Sets
users = [ ]so the NixOS module does not define a competingfluxd.serviceuser unit. - Leaves
openFirewall = false,approve.services = [ ](no PAM fingerprint approval) andwebcam.enable = false. - Home Manager (
inputs.nixarchy-flux.homeManagerModules.default): - Owns the
fluxd.serviceuser unit (wanted bygraphical-session.target). - Enables the Omarchy shell plugin (
plugin.enable = true), copied as a real folder to~/.config/omarchy/plugins/flux(not a symlink, becausefluxdplugin sync refuses symlinks). - Leaves the browser extension disabled (
browser.enable = false). - Avahi: Upstream's
lib.mkDefaultAvahi settings apply unless overridden. On p620, the host's explicitallow-interfaces = [ "enp1s0" ]pin wins. On razer, Avahi is filtered on untrusted networks by the guard below.
Hardening exceptions¶
fluxd.service(systemd user unit):fluxdserves the user's files, clipboard and phone link inside the graphical session.DynamicUserandProtectHomewould break access to the user session and~/.local/share/flux, andProtectSystem = "strict"requires mount namespacing that user units lack.NoNewPrivilegesis also omitted becausefluxdruns user-defined phone commands (commands.run) that may invokesudoor other setuid wrappers. It also sets no seccomp option such asLockPersonality: on a user unit that impliesNoNewPrivileges(#2909).flux-guard.serviceandflux-guard-sync.service(system units on razer): Both units omitDynamicUserbecause they needCAP_NET_ADMINin the host network namespace to loadnftablesrules (AF_NETLINK) and query active NetworkManager connections (AF_UNIX). They enforceCapabilityBoundingSet = [ "CAP_NET_ADMIN" ],NoNewPrivileges = true,ProtectSystem = "strict",ProtectHome = true,PrivateTmp = true,ReadWritePaths = [ "/run" ],RestrictAddressFamilies = [ "AF_NETLINK" "AF_UNIX" ]andProtectKernelModules = true.
Trusted-networks guard (razer)¶
fluxd listens on all addresses (control TCP 12100–12108, discovery UDP 12100, payload TCP 12070–12099), and
razer runs with the NixOS firewall disabled while roaming between home and guest Wi-Fi on the same interface
(wlp3s0).
When features.flux.trustedConnections is set to a list of NetworkManager connection UUIDs (null on p620, where
no guard is loaded):
flux-guard.serviceatomically loads theinet flux_guardnftables table beforenetwork-pre.target, with@trustedinitially holdingloandtailscale0.flux-guard-sync.serviceand a NetworkManager dispatcher script (up,down,dhcp4-change,connectivity-change) serialize on/run/flux-guard.lock, querynmcli -t -f UUID,DEVICE connection show --active, and atomically rebuild@trustedwithlo,tailscale0and any active device whose connection UUID is intrustedConnections.
What is blocked on untrusted networks¶
- Inbound: New connections (
ct state new) to TCP12070–12108and UDP12100are dropped. Replies torazer's own outbound connections still pass. - Outbound: All mDNS packets (
udp dport 5353andudp sport 5353) and Flux's UDP12100identity broadcasts are dropped, so neither Flux nor GNOME Remote Desktop announcesrazer. - Side effects on untrusted networks:
.localmDNS name resolution and printer/service discovery are disabled while connected to an untrusted network. - Tailscale:
tailscale0is always in@trusted, so Flux works in both directions over Tailscale on any network.
Adding a trusted network¶
UUIDs are used instead of SSIDs so network names stay out of the repository.
- Find the NetworkManager connection UUID on the host:
- Add the UUID to
features.flux.trustedConnectionsinhosts/razer/configuration.nix:
features.flux = {
enable = true;
trustedConnections = [
"2480c26b-7797-49e1-8a9f-af6bccc6d77c"
];
};
Manual setup steps¶
- Enable the Omarchy shell plugin: Run once from the desktop session on each host:
- Pair
razerfrom the phone: While on a trusted network (or Tailscale), open the Flux Android app and pair withrazeronce. Pairings and identity keys persist in~/.local/share/flux/(devices.json,certificate.pem,privateKey.pem). - Add the phone's Tailscale address: Add the phone's Tailscale IP as an extra address in Flux so
p620andrazercan reach the phone directly overtailscale0when off the home LAN or on an untrusted Wi-Fi network.