{ pkgs, config, lib, ... }: { # i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup # 直接从当前文件夹中读取配置文件作为配置内容 # wallpaper, binary file home.file.".config/i3/wallpaper.png".source = ../wallpapers/wallpaper.png; home.file.".config/i3/config".source = ./config; home.file.".config/i3/i3blocks.conf".source = ./i3blocks.conf; home.file.".config/i3/keybindings".source = ./keybindings; home.file.".config/i3/scripts" = { source = ./scripts; # copy the scripts directory recursively recursive = true; executable = true; # make all scripts executable }; home.file.".config/fcitx5/profile".source = ./profile; # fcitx5 每次切换输入法,就会修改 ~/.config/fcitx5/profile 文件,导致我用 hm 管理的配置被覆盖 # 解决方法是通过如下内置,每次 rebuild 前都先删除下 profile 文件 home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] '' rm -f "${config.xdg.configHome}/fcitx5/profile" ''; # allow fontconfig to discover fonts and configurations installed through home.packages fonts.fontconfig.enable = true; systemd.user.sessionVariables = { "LIBVA_DRIVER_NAME" = "nvidia"; "GBM_BACKEND" = "nvidia-drm"; "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; # copy from https://github.com/nix-community/home-manager/blob/master/modules/i18n/input-method/fcitx5.nix GLFW_IM_MODULE = "fcitx"; GTK_IM_MODULE = "fcitx"; QT_IM_MODULE = "fcitx"; XMODIFIERS = "@im=fcitx"; INPUT_METHOD = "fcitx"; IMSETTINGS_MODULE = "fcitx"; }; # set cursor size and dpi for 4k monitor xresources.properties = { "Xcursor.size" = 16; "Xft.dpi" = 160; }; }