{ config, lib, ... }:

with lib;

{
  environment.etc = mkIf (elem "etcfiles" config.machine.conffiles) {
    "i3/py3status".source = ./etc/i3/py3status;
    "sway/config".source = mkDefault ./etc/sway/config;
    "mpv/input.conf".source = ./etc/mpv/input.conf;
    "mpv/mpv.conf".source = ./etc/mpv/mpv.conf;
    "youtube-dl.conf".source = ./etc/youtube-dl.conf;
  };

  environment.variables = mkIf (elem "etcvars" config.machine.conffiles) {
    NIXPKGS_ALLOW_UNFREE="1";
    WINEDLLOVERRIDES="winemenubuilder.exe=d";
    LC_CTYPE="zh_CN.UTF-8";
    # This breaks a lot of applications
    # QT_SCALE_FACTOR="0.7";
  };
}