feat: nixos - nur - qqmusic/wechat-uos/dingtalk, rollback to i3

This commit is contained in:
ryan4yin
2023-05-14 01:32:47 +08:00
parent abb7c84675
commit 47a7828bc7
10 changed files with 147 additions and 68 deletions

View File

@@ -3,7 +3,8 @@
{
imports = [
./hyprland
# ./hyprland
./i3
./programs
./rofi
./shell

View File

@@ -1,6 +1,7 @@
{
pkgs,
config,
lib,
...
}: {
# hyprland configs, based on https://github.com/notwidow/hyprland

View File

@@ -1,6 +1,7 @@
{
pkgs,
config,
lib,
...
}: {
# i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup
@@ -18,16 +19,34 @@
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" = 192;
"Xft.dpi" = 150;
};
# 直接以 text 的方式,在 nix 配置文件中硬编码文件内容
# home.file.".xxx".text = ''
# xxx
# '';
}

17
home/i3/profile Normal file
View File

@@ -0,0 +1,17 @@
[Groups/0]
# Group Name
Name=Other
# Layout
Default Layout=us
# Default Input Method
DefaultIM=rime
[Groups/0/Items/0]
# Name
Name=rime
# Layout
Layout=
[GroupOrder]
0=Other

View File

@@ -10,7 +10,8 @@
};
in {
home.packages = with pkgs-stable; [
firefox-wayland
# firefox-wayland
firefox
];
programs = {
@@ -23,26 +24,26 @@
# https://github.com/swaywm/sway/issues/7562
package = pkgs-stable.google-chrome;
commandLineArgs = [
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
# (only supported by chromium/chrome at this time, not electron)
"--gtk-version=4"
# make it use text-input-v1, which works for kwin 5.27 and weston
# "--enable-wayland-ime"
# commandLineArgs = [
# # make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
# # (only supported by chromium/chrome at this time, not electron)
# "--gtk-version=4"
# # make it use text-input-v1, which works for kwin 5.27 and weston
# # "--enable-wayland-ime"
# enable hardware acceleration - vulkan api
# "--enable-features=Vulkan"
];
# # enable hardware acceleration - vulkan api
# # "--enable-features=Vulkan"
# ];
};
vscode = {
enable = true;
# use the stable version
package = pkgs-stable.vscode.override {
commandLineArgs = [
# make it use text-input-v1, which works for kwin 5.27 and weston
# "--enable-wayland-ime"
];
# commandLineArgs = [
# # make it use text-input-v1, which works for kwin 5.27 and weston
# # "--enable-wayland-ime"
# ];
};
# let vscode sync and update its configuration & extensions across devices, using github account.

View File

@@ -1,4 +1,7 @@
{pkgs, ...}: {
{pkgs, config, ...}:
{
home.packages = with pkgs; [
# archives
zip
@@ -88,7 +91,6 @@
# instant messaging
telegram-desktop
discord
# qq & wechat are alse in the official nixpkgs
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
# music