{
  config,
  lib,
  pkgs,
  ...
}:
with lib;
{
  environment.etc = mkIf (elem "etcfiles" config.machine.conffiles) {
    "rofi.rasi".source = import ./etc/rofi.rasi.nix { inherit pkgs; };
    "i3/py3status".source = ./etc/i3/py3status;
    "sway/config".source = mkDefault (import ./etc/sway/config.nix { inherit pkgs; });
    "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) {
    # Bat breaks manpages
    # https://github.com/sharkdp/bat/issues/2563
    MANROFFOPT = "-c";
    LC_CTYPE = "zh_CN.UTF-8";
    MANPAGER = "sh -c 'col -bx | bat -l man -p'";
    MPV_HOME = "/etc/mpv";
    NIXPKGS_ALLOW_UNFREE = "1";
    WINEDLLOVERRIDES = "winemenubuilder.exe=d";
    # This breaks a lot of applications
    # QT_SCALE_FACTOR="0.7";
  };
}