init
This commit is contained in:
35
modules/laptop/zwift.nix
Normal file
35
modules/laptop/zwift.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user