Files
nix-config/modules/nixos/desktop/computer-use.nix
T
Ryan Yin e4c2548a93 refactor: replace redundant mkForce with plain values and mkDefault
Each of these overrode a value nothing else set at a higher priority:

- qemu-guest: btrbk, hardwareTools and cloud-init have no competing
  definition on the guests.
- mdns: nixpkgs' sunshine module sets avahi.publish.* with mkDefault.
- computer-use: i18n now sets the time zone with mkDefault.
- darwin terminal: the shared ghostty/kitty font sizes are now mkDefault.
- shoukei: sunshine is mkDefault false in remote-desktop.nix, zram's
  memoryPercent is mkDefault 50; supportedFilesystems now merges instead
  of discarding the fsType entries other modules add.
- youko: nothing enables docker.
- nixpak: pasta.enable and sockets.pipewire are mkDefault in the shared
  modules, sockets.pulse already was.

Every NixOS host's toplevel drvPath is unchanged; on fern and frieren the
terminal font sizes and time zone evaluate to the same values.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 10:14:27 -06:00

49 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
myvars,
...
}:
let
cfg = config.modules.desktop.computerUse;
username = myvars.username;
# Keep the guest timezone consistent with the proxy's exit region. A
# China-based timezone with a US/JP exit IP is a strong automation signal.
timeZone = if cfg.proxyRegion == "jp" then "Asia/Tokyo" else "America/Los_Angeles";
in
{
options.modules.desktop.computerUse = {
enable = lib.mkEnableOption "headless computer-use environment (X11 + desktop automation)";
proxyRegion = lib.mkOption {
type = lib.types.enum [
"us"
"jp"
];
default = "us";
description = "Proxy exit region; keeps the timezone consistent with the egress IP.";
};
};
config = lib.mkIf cfg.enable {
users.users."${username}".linger = true;
# computer-use-linux / cua-driver read the AT-SPI accessibility tree.
services.gnome.at-spi2-core.enable = true;
# A sparse font set is itself a browser fingerprinting signal, so ship the
# same rich font set the desktops use.
modules.desktop.fonts.enable = true;
# Mesa userspace (software GL for X11).
hardware.graphics.enable = true;
# Match the proxy's exit region.
time.timeZone = timeZone;
# Browsers keep their profile/preferences in dconf.
programs.dconf.enable = true;
};
}