This commit is contained in:
Amaury JOLY
2026-03-10 18:51:49 +01:00
commit d6a66c16b8
25 changed files with 1653 additions and 0 deletions

35
modules/laptop/zwift.nix Normal file
View File

@@ -0,0 +1,35 @@
# Module: Zwift Configuration
# Description: Configures Zwift cycling simulator via Docker with proper networking
# Services: Zwift Docker container
# Ports: UDP 3022, 3024 / TCP 21587, 21588
{ config, lib, pkgs, customConfig, ... }:
{
options.custom.zwift = {
enable = lib.mkEnableOption "Zwift cycling simulator";
};
config = lib.mkIf config.custom.zwift.enable {
programs.zwift = {
enable = true;
image = "docker.io/netbrain/zwift";
version = "latest"; # FIXME: Pin to specific version for reproducibility
containerTool = "docker";
zwiftWorkoutDir = "/var/lib/zwift/workouts";
zwiftActivityDir = "/var/lib/zwift/activities";
zwiftLogDir = "/var/lib/zwift/logs";
zwiftScreenshotsDir = "/var/lib/zwift/screenshots";
zwiftFg = true;
networking = "bridge";
# Use actual user UID/GID instead of hardcoded 1000
zwiftUid = toString config.users.users."${customConfig.username}".uid;
zwiftGid = toString config.users.groups.users.gid;
};
networking.firewall = {
allowedUDPPorts = [ 3022 3024 ];
allowedTCPPorts = [ 21587 21588 ];
};
};
}