diff --git a/flake.lock b/flake.lock index 45888d9..80fea66 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1744743431, - "narHash": "sha256-iyn/WBYDc7OtjSawbegINDe/gIkok888kQxk3aVnkgg=", + "lastModified": 1746171682, + "narHash": "sha256-EyXUNSa+H+YvGVuQJP1nZskXAowxKYp79RNUsNdQTj4=", "owner": "nix-community", "repo": "home-manager", - "rev": "c61bfe3ae692f42ce688b5865fac9e0de58e1387", + "rev": "50eee705bbdbac942074a8c120e8194185633675", "type": "github" }, "original": { @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1745205007, - "narHash": "sha256-k67bEcLkSo13TIBfs0CGYkJjG12aaikabMtxWbSeqr0=", + "lastModified": 1746413188, + "narHash": "sha256-i6BoiQP0PasExESQHszC0reQHfO6D4aI2GzOwZMOI20=", "owner": "nix-community", "repo": "home-manager", - "rev": "3fbe9a2b76ff5c4dcb2a2a2027dac31cfc993c8c", + "rev": "8a318641ac13d3bc0a53651feaee9560f9b2d89a", "type": "github" }, "original": { @@ -58,11 +58,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744440957, - "narHash": "sha256-FHlSkNqFmPxPJvy+6fNLaNeWnF1lZSgqVCl/eWaJRc4=", + "lastModified": 1746301764, + "narHash": "sha256-5odz+NZszRya//Zd0P8h+sIwOnV35qJi+73f4I+iv1M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "26d499fc9f1d567283d5d56fcf367edd815dba1d", + "rev": "537ee98218704e21ea465251de512ab6bbb9012e", "type": "github" }, "original": { @@ -74,11 +74,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1744932701, - "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", + "lastModified": 1746328495, + "narHash": "sha256-uKCfuDs7ZM3QpCE/jnfubTg459CnKnJG/LwqEVEdEiw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", + "rev": "979daf34c8cacebcd917d540070b52a3c2b9b16e", "type": "github" }, "original": { diff --git a/modules/home/hyprland/conf/hypr/hyprland.conf b/modules/home/hyprland/conf/hypr/hyprland.conf index f049fd0..8c54c7c 100644 --- a/modules/home/hyprland/conf/hypr/hyprland.conf +++ b/modules/home/hyprland/conf/hypr/hyprland.conf @@ -30,6 +30,7 @@ exec-once = waybar # launch the system panel exec-once = blueman-applet # systray app for BT exec-once = mako # start notification demon exec-once = fcitx5 -d -r +exec-once = swww-daemon # exec-once = nm-applet --indicator # systray app for Network/Wifi # exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH # exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP # for XDPH diff --git a/modules/home/hyprland/conf/hypr/keybindings.conf b/modules/home/hyprland/conf/hypr/keybindings.conf index 7db399c..faf66a0 100644 --- a/modules/home/hyprland/conf/hypr/keybindings.conf +++ b/modules/home/hyprland/conf/hypr/keybindings.conf @@ -8,7 +8,7 @@ ################################################ # Main modifier ################################################ -$mainMod = SUPER # windows key +$mod = SUPER # windows key $terminal = kitty $filemanager = dolphin @@ -17,27 +17,27 @@ $filemanager = dolphin ################################################ # Main actions ################################################ -bind = $mainMod, C, killactive # killactive, kill the window on focus -bind = $mainMod CTRL, delete, exit, # kill hyperland session -bind = $mainMod, F, togglefloating, # toggle the window on focus to float -bind = $mainMod CTRL, L, exec, swaylock # lock screen -bind = $mainMod, P, pseudo, # dwindle -bind = $mainMod, S, togglesplit, # split screen -bind = $mainMod, return, fullscreen, # toggle the window on focus to fullscreen +bind = $mod, C, killactive # killactive, kill the window on focus +bind = $mod CTRL, delete, exit, # kill hyperland session +bind = $mod, F, togglefloating, # toggle the window on focus to float +bind = $mod CTRL, L, exec, swaylock # lock screen +bind = $mod, P, pseudo, # dwindle +bind = $mod, S, togglesplit, # split screen +bind = $mod, return, fullscreen, # toggle the window on focus to fullscreen +bind = $mod, F1, exec, ~/.config/hypr/scripts/keybinds.sh # Application shortcuts -bind = $mainMod, grave, exec, $terminal # ~ open terminal -bind = $mainMod, E, exec, $filemanager # open file manager -bind = $mainMod, V, exec, code # open vscode +bind = $mod, grave, exec, $terminal # ~ open terminal +bind = $mod, E, exec, $filemanager # open file manager +bind = $mod, V, exec, code # open vscode ################################################ # Control actions ################################################ # Rofi is toggled on/off if you repeat the key presses -bind = $mainMod, SPACE, exec, pkill rofi || rofi -show drun # launch desktop applications -bind = $mainMod, tab, exec, pkill rofi || rofi -show window # switch between desktop applications -bind = $mainMod, E, exec, pkill rofi || rofi -show filebrowser # browse system files -bind = $mainMod, R, exec, pkill rofi || rofi -show run # run a command +bind = $mod, SPACE, exec, pkill rofi || rofi -show drun # launch desktop applications +bind = $mod, E, exec, pkill rofi || rofi -show filebrowser # browse system files +bind = $mod, R, exec, pkill rofi || rofi -show run # run a command # Audio control # bind = , F10, exec, ~/.config/hypr/scripts/volumecontrol.sh -o m # toggle audio mute @@ -53,94 +53,93 @@ bind = , XF86AudioNext, exec, playerctl next bind = , XF86AudioPrev, exec, playerctl previous # Screenshot/screencapture -bind = , PRINT, exec, hyprshot -m window -bind = ALT, PRINT, exec, hyprshot -m region +bind = , PRINT, exec, hyprshot -z -m window +bind = ALT, PRINT, exec, hyprshot -z -m region ################################################ # Exec custom scripts ################################################ -bind = $mainMod, G, exec, ~/.config/hypr/scripts/gamemode.sh # disable hypr effects for gamemode +bind = $mod, G, exec, ~/.config/hypr/scripts/gamemode.sh # disable hypr effects for gamemode ################################################ # Window actions ################################################ -# Move focus with mainMod + arrow keys -bind = $mainMod, left, movefocus, l -bind = $mainMod, H, movefocus, l -bind = $mainMod, right, movefocus, r -bind = $mainMod, L, movefocus, r -bind = $mainMod, up, movefocus, u -bind = $mainMod, K, movefocus, u -bind = $mainMod, down, movefocus, d -bind = $mainMod, J, movefocus, d +# Move focus with mod + arrow keys +bind = $mod, left, movefocus, l +bind = $mod, H, movefocus, l +bind = $mod, right, movefocus, r +bind = $mod, L, movefocus, r +bind = $mod, up, movefocus, u +bind = $mod, K, movefocus, u +bind = $mod, down, movefocus, d +bind = $mod, J, movefocus, d # Resize windows -binde = $mainMod CONTROL, right, resizeactive, 10 0 -binde = $mainMod CONTROL, left, resizeactive, -10 0 -binde = $mainMod CONTROL, up, resizeactive, 0 -10 -binde = $mainMod CONTROL, down, resizeactive, 0 10 +binde = $mod CONTROL, right, resizeactive, 10 0 +binde = $mod CONTROL, left, resizeactive, -10 0 +binde = $mod CONTROL, up, resizeactive, 0 -10 +binde = $mod CONTROL, down, resizeactive, 0 10 -# Move Window with mainMod + SHIFT + arrow keys -bind = $mainMod SHIFT, left, movewindow, l -bind = $mainMod SHIFT, right, movewindow, r -bind = $mainMod SHIFT, up, movewindow, u -bind = $mainMod SHIFT, down, movewindow, d +# Move Window with mod + SHIFT + arrow keys +bind = $mod SHIFT, left, movewindow, l +bind = $mod SHIFT, right, movewindow, r +bind = $mod SHIFT, up, movewindow, u +bind = $mod SHIFT, down, movewindow, d -# Move/resize windows with mainMod + LMB/RMB and dragging -bindm = $mainMod, mouse:272, movewindow -bindm = $mainMod, mouse:273, resizewindow +# Move/resize windows with mod + LMB/RMB and dragging +bindm = $mod, mouse:272, movewindow +bindm = $mod, mouse:273, resizewindow ################################################ # Workspace actions ################################################ -# Switch workspaces with mainMod + [0-9] -bind = $mainMod, 1, workspace, 1 -bind = $mainMod, 2, workspace, 2 -bind = $mainMod, 3, workspace, 3 -bind = $mainMod, 4, workspace, 4 -bind = $mainMod, 5, workspace, 5 -bind = $mainMod, 6, workspace, 6 -bind = $mainMod, 7, workspace, 7 -bind = $mainMod, 8, workspace, 8 -bind = $mainMod, 9, workspace, 9 -bind = $mainMod, 0, workspace, 10 +# Switch workspaces with mod + [0-9] +bind = $mod, 1, workspace, 1 +bind = $mod, 2, workspace, 2 +bind = $mod, 3, workspace, 3 +bind = $mod, 4, workspace, 4 +bind = $mod, 5, workspace, 5 +bind = $mod, 6, workspace, 6 +bind = $mod, 7, workspace, 7 +bind = $mod, 8, workspace, 8 +bind = $mod, 9, workspace, 9 +bind = $mod, 0, workspace, 10 -# Move active window to a workspace with mainMod + SHIFT + [0-9] -bind = $mainMod SHIFT, 1, movetoworkspace, 1 -bind = $mainMod SHIFT, 2, movetoworkspace, 2 -bind = $mainMod SHIFT, 3, movetoworkspace, 3 -bind = $mainMod SHIFT, 4, movetoworkspace, 4 -bind = $mainMod SHIFT, 5, movetoworkspace, 5 -bind = $mainMod SHIFT, 6, movetoworkspace, 6 -bind = $mainMod SHIFT, 7, movetoworkspace, 7 -bind = $mainMod SHIFT, 8, movetoworkspace, 8 -bind = $mainMod SHIFT, 9, movetoworkspace, 9 -bind = $mainMod SHIFT, 0, movetoworkspace, 10 +# Move active window to a workspace with mod + SHIFT + [0-9] +bind = $mod SHIFT, 1, movetoworkspace, 1 +bind = $mod SHIFT, 2, movetoworkspace, 2 +bind = $mod SHIFT, 3, movetoworkspace, 3 +bind = $mod SHIFT, 4, movetoworkspace, 4 +bind = $mod SHIFT, 5, movetoworkspace, 5 +bind = $mod SHIFT, 6, movetoworkspace, 6 +bind = $mod SHIFT, 7, movetoworkspace, 7 +bind = $mod SHIFT, 8, movetoworkspace, 8 +bind = $mod SHIFT, 9, movetoworkspace, 9 +bind = $mod SHIFT, 0, movetoworkspace, 10 # Move window to workspace Super + Alt + [0-9] -bind = $mainMod ALT, 1, movetoworkspacesilent, 1 -bind = $mainMod ALT, 2, movetoworkspacesilent, 2 -bind = $mainMod ALT, 3, movetoworkspacesilent, 3 -bind = $mainMod ALT, 4, movetoworkspacesilent, 4 -bind = $mainMod ALT, 5, movetoworkspacesilent, 5 -bind = $mainMod ALT, 6, movetoworkspacesilent, 6 -bind = $mainMod ALT, 7, movetoworkspacesilent, 7 -bind = $mainMod ALT, 8, movetoworkspacesilent, 8 -bind = $mainMod ALT, 9, movetoworkspacesilent, 9 -bind = $mainMod ALT, 0, movetoworkspacesilent, 10 +bind = $mod ALT, 1, movetoworkspacesilent, 1 +bind = $mod ALT, 2, movetoworkspacesilent, 2 +bind = $mod ALT, 3, movetoworkspacesilent, 3 +bind = $mod ALT, 4, movetoworkspacesilent, 4 +bind = $mod ALT, 5, movetoworkspacesilent, 5 +bind = $mod ALT, 6, movetoworkspacesilent, 6 +bind = $mod ALT, 7, movetoworkspacesilent, 7 +bind = $mod ALT, 8, movetoworkspacesilent, 8 +bind = $mod ALT, 9, movetoworkspacesilent, 9 +bind = $mod ALT, 0, movetoworkspacesilent, 10 # Special workspaces (scratchpad) -bind = $mainMod ALT, S, movetoworkspacesilent, special -bind = $mainMod CONTROL, S, togglespecialworkspace, +bind = $mod ALT, S, movetoworkspacesilent, special +bind = $mod CONTROL, S, togglespecialworkspace, -# Scroll through existing workspaces with mainMod + scroll -bind = $mainMod CTRL, right, workspace, e+1 -bind = $mainMod, mouse_up, workspace, e+1 -bind = ALT, Tab, workspace, e+1 +# Scroll through existing workspaces with mod + scroll +bind = $mod CTRL, right, workspace, e+1 +bind = $mod, mouse_up, workspace, e+1 -bind = $mainMod CTRL, left, workspace, e-1 -bind = $mainMod, mouse_down, workspace, e-1 +bind = $mod CTRL, left, workspace, e-1 +bind = $mod, mouse_down, workspace, e-1` \ No newline at end of file diff --git a/modules/home/hyprland/conf/hypr/scripts/keybinds.sh b/modules/home/hyprland/conf/hypr/scripts/keybinds.sh new file mode 100755 index 0000000..1354337 --- /dev/null +++ b/modules/home/hyprland/conf/hypr/scripts/keybinds.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env sh + +# 简单示例:从 hyprland.conf 提取非注释的 bind= 行 +# 注意:这可能需要根据你的配置复杂性进行调整(例如处理逗号后的空格、多行绑定等) +grep '^bind =' ~/.config/hypr/keybindings.conf | \ +sed 's/^bind = //; s/, /\t/' | \ +# 可以进一步处理,比如移除 exec 后面的命令细节,只留动作描述 +# sed -E 's/,(.+)/ : \1/' | # 简单替换 +column -t -s $'\t' | \ +rofi -dmenu -i -p "Hyprland Keybinds" -markup-rows -config ~/.config/rofi/config-keybinds.rasi +# 或者使用 wofi: +# wofi --dmenu --prompt "Hyprland Keybinds" --insensitive \ No newline at end of file diff --git a/modules/home/hyprland/conf/hypr/windowrules.conf b/modules/home/hyprland/conf/hypr/windowrules.conf index 17d55f8..f31ceb0 100644 --- a/modules/home/hyprland/conf/hypr/windowrules.conf +++ b/modules/home/hyprland/conf/hypr/windowrules.conf @@ -10,8 +10,8 @@ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Float rules for system dialogs and popups -windowrulev2 = float,class:^(.*)$,title:^(Open [Ff]ile) -windowrulev2 = center,class:^(.*)$,title:^(Open [Ff]ile) +windowrulev2 = float,class:^(.*)$,title:^(Open [Ff]iles?) +windowrulev2 = center,class:^(.*)$,title:^(Open [Ff]iles?) windowrulev2 = float,class:^(.*)$,title:^(Open [Ff]older) windowrulev2 = center,class:^(.*)$,title:^(Open [Ff]older) @@ -35,6 +35,6 @@ windowrulev2 = float,class:^(blueman-manager)$ windowrulev2 = opacity 0.80 0.70,class:^(blueman-manager)$ -windowrulev2 = opacity 0.50 0.50,class:^(Code)$ +windowrulev2 = opacity 1.00 1.00,class:^(code)$ windowrulev2 = opacity 0.80 0.80,class:^(code-url-handler)$ -windowrulev2 = opacity 0.80 0.80,class:^(kitty)$ +windowrulev2 = opacity 0.50 0.50,class:^(kitty)$ diff --git a/modules/home/hyprland/conf/rofi/config.rasi b/modules/home/hyprland/conf/rofi/config.rasi index a038244..0ae9544 100644 --- a/modules/home/hyprland/conf/rofi/config.rasi +++ b/modules/home/hyprland/conf/rofi/config.rasi @@ -33,8 +33,8 @@ configuration { window { background-color: @bg0; location: center; - width: 560px; - height: 450px; + width: 720px; + height: 500px; border-radius: 8px; border: 1px; border-color: @bg1; diff --git a/modules/home/hyprland/conf/waybar/config.jsonc b/modules/home/hyprland/conf/waybar/config.jsonc index bc78030..90341c7 100644 --- a/modules/home/hyprland/conf/waybar/config.jsonc +++ b/modules/home/hyprland/conf/waybar/config.jsonc @@ -79,14 +79,15 @@ "org.gnome.Nautilus": "󰪶", "wechat": "", "wps": "󰈬", - "class": "󰈛" + "class": "󰈛", + "vlc": "󰕼" } }, "hyprland/window": { "format": "{title}", - "tooltip-format": "{title}", - "rewrite": { "^(.{30}).+": "$1..." }, + "tooltip-format": "[{class}]: {title}", + "max-length": 30, "separate-outputs": true }, diff --git a/modules/home/hyprland/default.nix b/modules/home/hyprland/default.nix index fdf2671..eda44da 100644 --- a/modules/home/hyprland/default.nix +++ b/modules/home/hyprland/default.nix @@ -19,17 +19,18 @@ in }; home.packages = with pkgs; [ + hyprshot #screenshot waybar # the status bar swww # wallpaper libnotify # for notify-send command mako # notify daemon - hyprshot #screenshot rofi # app launcher kitty # terminal wlogout # logout menu killall pavucontrol # audio control - nautilus #file manager for GNOME + nemo #file manager + jq # json query util ]; diff --git a/modules/home/vscode/settings.json b/modules/home/vscode/settings.json index 4d3e34b..e52f253 100644 --- a/modules/home/vscode/settings.json +++ b/modules/home/vscode/settings.json @@ -48,5 +48,12 @@ "workbench.colorTheme": "Default Light Modern", "augment.chat.userGuidelines": "Always response in 中文", "augment.completions.enableAutomaticCompletions": true, - "editor.fontFamily": "'Source Code Pro', 'JetBrainsMono Nerd Font'" + "editor.fontFamily": "'Source Code Pro', 'JetBrainsMono Nerd Font'", + "github.copilot.enable": { + "*": true, + "plaintext": false, + "markdown": false, + "scminput": false, + "nix": true + } } diff --git a/modules/home/xdg.nix b/modules/home/xdg.nix index 91c34a2..f330232 100644 --- a/modules/home/xdg.nix +++ b/modules/home/xdg.nix @@ -60,10 +60,10 @@ "image/webp" = [ "imv.desktop" ]; "inode/directory" = [ ] + ++ (if config.xdg.enable then [ "nemo.desktop" ] else [ ]) ++ (if config.xdg.enable then [ "xdg-open.desktop" ] else [ ]) ++ (if config.xdg.enable then [ "nemo.desktop" ] else [ ]) ++ (if config.xdg.enable then [ "thunar.desktop" ] else [ ]) - ++ (if config.xdg.enable then [ "nemo.desktop" ] else [ ]) ++ (if config.xdg.enable then [ "org.gnome.Nautilus.desktop" ] else [ ]); }; diff --git a/modules/nixos/core/default.nix b/modules/nixos/core/default.nix index 193a5d6..d202a49 100644 --- a/modules/nixos/core/default.nix +++ b/modules/nixos/core/default.nix @@ -3,132 +3,19 @@ imports = [ ./boot.nix ./system.nix + ./nixld.nix ]; + environment = { + systemPackages = with pkgs; + [ + smartmontools + ]; + }; + programs = { git.enable = true; dconf.enable = true; - - # Allow to run prebuild binary app - nix-ld = { - enable = true; - libraries = with pkgs; [ - SDL # 简单直接媒体层,用于图形、音频、输入等的跨平台库 - SDL2 # SDL的第二个主要版本,提供更多功能 - SDL2_image # SDL2的图像加载库,支持多种图像格式 - SDL2_mixer # SDL2的音频混合库,用于播放多种音频格式 - SDL2_ttf # SDL2的TrueType字体渲染库 - SDL_image # SDL1的图像加载库 - SDL_mixer # SDL1的音频混合库 - SDL_ttf # SDL1的TrueType字体渲染库 - alsa-lib # 高级Linux声音架构库,提供音频功能 - at-spi2-atk # 辅助技术服务提供者接口,连接ATK和AT-SPI - at-spi2-core # 辅助技术服务提供者接口核心组件 - atk # 辅助技术工具包,提供辅助功能支持 - bzip2 # 高质量的数据压缩库 - cairo # 2D图形渲染库,支持多种输出设备 - cups # 通用Unix打印系统,提供打印功能 - curlWithGnuTls # 使用GnuTLS的URL传输库,用于网络请求 - dbus # 进程间通信系统,用于应用程序之间的通信 - dbus-glib # D-Bus的GLib绑定 - desktop-file-utils # 用于处理桌面条目文件的工具 - e2fsprogs # ext2/3/4文件系统工具 - expat # XML解析库 - flac # 无损音频编解码器 - fontconfig # 字体配置和自定义库 - freeglut # OpenGL实用工具包,用于创建OpenGL上下文 - freetype # 字体渲染引擎 - fribidi # Unicode双向文本算法实现 - fuse # 用户空间文件系统接口 - fuse3 # FUSE的第3版,用户空间文件系统接口 - gdk-pixbuf # 图像加载库,GNOME的一部分 - glew110 # OpenGL扩展加载库1.10版本 - glib # 通用工具库,提供数据结构处理、移植等功能 - gmp # GNU多精度算术库 - gst_all_1.gst-plugins-base # GStreamer基础插件集 - gst_all_1.gst-plugins-ugly # GStreamer非自由插件集 - gst_all_1.gstreamer # 多媒体框架 - gtk2 # 图形用户界面工具包第2版 - gtk3 # 图形用户界面工具包第2版 - harfbuzz # 文本整形引擎 - icu # 国际化组件,提供Unicode和全球化支持 - keyutils.lib # Linux密钥管理工具库 - libGL # OpenGL库 - libGLU # OpenGL实用工具库 - libappindicator-gtk2 # 应用程序指示器库,用于系统托盘图标 - libcaca # 彩色ASCII艺术库 - libcanberra # 声音主题规范的实现 - libcap # POSIX能力库 - libclang.lib # Clang编译器库 - libdbusmenu # D-Bus菜单库 - libdrm # 直接渲染管理器库 - libgbm # Open source 3D graphics library - libgcrypt # GNU加密库 - libgpg-error # GnuPG错误报告库 - libidn # 国际化域名库 - libjack2 # JACK音频连接套件第2版 - libjpeg # JPEG图像编解码库 - libmikmod # 模块音乐库 - libogg # Ogg多媒体容器格式库 - libpng12 # PNG图像编解码库1.2版本 - librsvg # SVG渲染库 - libsamplerate # 音频采样率转换库 - libthai # 泰语支持库 - libtheora # Theora视频编解码库 - libtiff # TIFF图像编解码库 - libudev0-shim # 旧版udev库兼容层 - libusb1 # USB设备访问库 - libuuid # UUID生成和解析库 - libvdpau # 视频解码和呈现API - libvorbis # Vorbis音频编解码库 - libvpx # VP8/VP9视频编解码库 - libxcrypt-legacy # 旧版密码哈希库 - libxkbcommon # 键盘处理库 - libxml2 # XML解析和生成库 - mesa # 开源OpenGL实现 - nspr # Netscape可移植运行时 - nss # 网络安全服务 - openssl # 安全套接字层库 - p11-kit # PKCS#11模块加载库 - pango # 文本布局和渲染库 - pixman # 像素操作库 - python3 # Python编程语言解释器 - speex # 语音压缩格式 - stdenv.cc.cc # 标准C编译器 - tbb # 英特尔线程构建块库 - udev # 设备管理器 - vulkan-loader # Vulkan图形API加载器 - wayland # 显示服务器协议 - xorg.libICE # X11 Inter-Client Exchange库 - xorg.libSM # X11会话管理库 - xorg.libX11 # X11客户端库 - xorg.libXScrnSaver # X11屏幕保护扩展库 - xorg.libXcomposite # X11合成扩展库 - xorg.libXcursor # X11光标管理库 - xorg.libXdamage # X11损坏扩展库 - xorg.libXext # X11通用扩展库 - xorg.libXfixes # X11修复扩展库 - xorg.libXft # X11 FreeType接口库 - xorg.libXi # X11输入扩展库 - xorg.libXinerama # X11多显示器扩展库 - xorg.libXmu # X11杂项实用工具库 - xorg.libXrandr # X11调整大小和旋转扩展库 - xorg.libXrender # X11渲染扩展库 - xorg.libXt # X11工具包内省库 - xorg.libXtst # X11测试扩展库 - xorg.libXxf86vm # X11 XFree86视频模式扩展库 - xorg.libpciaccess # X11 PCI访问库 - xorg.libxcb # X11 C绑定库 - xorg.xcbutil # XCB实用工具库 - xorg.xcbutilimage # XCB图像实用工具库 - xorg.xcbutilkeysyms # XCB键符号实用工具库 - xorg.xcbutilrenderutil # XCB渲染实用工具库 - xorg.xcbutilwm # XCB窗口管理实用工具库 - xorg.xkeyboardconfig # X11键盘配置数据库 - xz # LZMA压缩工具 - zlib # 通用数据压缩库 - ]; - }; }; # Configure firewall @@ -139,18 +26,19 @@ }; # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "zh_CN.UTF-8"; - LC_IDENTIFICATION = "zh_CN.UTF-8"; - LC_MEASUREMENT = "zh_CN.UTF-8"; - LC_MONETARY = "zh_CN.UTF-8"; - LC_NAME = "zh_CN.UTF-8"; - LC_NUMERIC = "zh_CN.UTF-8"; - LC_PAPER = "zh_CN.UTF-8"; - LC_TELEPHONE = "zh_CN.UTF-8"; - LC_TIME = "zh_CN.UTF-8"; + i18n = { + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "zh_CN.UTF-8"; + LC_IDENTIFICATION = "zh_CN.UTF-8"; + LC_MEASUREMENT = "zh_CN.UTF-8"; + LC_MONETARY = "zh_CN.UTF-8"; + LC_NAME = "zh_CN.UTF-8"; + LC_NUMERIC = "zh_CN.UTF-8"; + LC_PAPER = "zh_CN.UTF-8"; + LC_TELEPHONE = "zh_CN.UTF-8"; + LC_TIME = "zh_CN.UTF-8"; + }; }; time.timeZone = "Asia/Shanghai"; diff --git a/modules/nixos/core/nixld.nix b/modules/nixos/core/nixld.nix new file mode 100644 index 0000000..f018da4 --- /dev/null +++ b/modules/nixos/core/nixld.nix @@ -0,0 +1,125 @@ +{ pkgs, ... }: +{ + programs = { + # Allow to run prebuild binary app + nix-ld = { + enable = true; + libraries = with pkgs; [ + SDL # 简单直接媒体层,用于图形、音频、输入等的跨平台库 + SDL2 # SDL的第二个主要版本,提供更多功能 + SDL2_image # SDL2的图像加载库,支持多种图像格式 + SDL2_mixer # SDL2的音频混合库,用于播放多种音频格式 + SDL2_ttf # SDL2的TrueType字体渲染库 + SDL_image # SDL1的图像加载库 + SDL_mixer # SDL1的音频混合库 + SDL_ttf # SDL1的TrueType字体渲染库 + alsa-lib # 高级Linux声音架构库,提供音频功能 + at-spi2-atk # 辅助技术服务提供者接口,连接ATK和AT-SPI + at-spi2-core # 辅助技术服务提供者接口核心组件 + atk # 辅助技术工具包,提供辅助功能支持 + bzip2 # 高质量的数据压缩库 + cairo # 2D图形渲染库,支持多种输出设备 + cups # 通用Unix打印系统,提供打印功能 + curlWithGnuTls # 使用GnuTLS的URL传输库,用于网络请求 + dbus # 进程间通信系统,用于应用程序之间的通信 + dbus-glib # D-Bus的GLib绑定 + desktop-file-utils # 用于处理桌面条目文件的工具 + e2fsprogs # ext2/3/4文件系统工具 + expat # XML解析库 + flac # 无损音频编解码器 + fontconfig # 字体配置和自定义库 + freeglut # OpenGL实用工具包,用于创建OpenGL上下文 + freetype # 字体渲染引擎 + fribidi # Unicode双向文本算法实现 + fuse # 用户空间文件系统接口 + fuse3 # FUSE的第3版,用户空间文件系统接口 + gdk-pixbuf # 图像加载库,GNOME的一部分 + glew110 # OpenGL扩展加载库1.10版本 + glib # 通用工具库,提供数据结构处理、移植等功能 + gmp # GNU多精度算术库 + gst_all_1.gst-plugins-base # GStreamer基础插件集 + gst_all_1.gst-plugins-ugly # GStreamer非自由插件集 + gst_all_1.gstreamer # 多媒体框架 + gtk2 # 图形用户界面工具包第2版 + gtk3 # 图形用户界面工具包第2版 + harfbuzz # 文本整形引擎 + icu # 国际化组件,提供Unicode和全球化支持 + keyutils.lib # Linux密钥管理工具库 + libGL # OpenGL库 + libGLU # OpenGL实用工具库 + libappindicator-gtk2 # 应用程序指示器库,用于系统托盘图标 + libcaca # 彩色ASCII艺术库 + libcanberra # 声音主题规范的实现 + libcap # POSIX能力库 + libclang.lib # Clang编译器库 + libdbusmenu # D-Bus菜单库 + libdrm # 直接渲染管理器库 + libgbm # Open source 3D graphics library + libgcrypt # GNU加密库 + libgpg-error # GnuPG错误报告库 + libidn # 国际化域名库 + libjack2 # JACK音频连接套件第2版 + libjpeg # JPEG图像编解码库 + libmikmod # 模块音乐库 + libogg # Ogg多媒体容器格式库 + libpng12 # PNG图像编解码库1.2版本 + librsvg # SVG渲染库 + libsamplerate # 音频采样率转换库 + libthai # 泰语支持库 + libtheora # Theora视频编解码库 + libtiff # TIFF图像编解码库 + libudev0-shim # 旧版udev库兼容层 + libusb1 # USB设备访问库 + libuuid # UUID生成和解析库 + libvdpau # 视频解码和呈现API + libvorbis # Vorbis音频编解码库 + libvpx # VP8/VP9视频编解码库 + libxcrypt-legacy # 旧版密码哈希库 + libxkbcommon # 键盘处理库 + libxml2 # XML解析和生成库 + mesa # 开源OpenGL实现 + nspr # Netscape可移植运行时 + nss # 网络安全服务 + openssl # 安全套接字层库 + p11-kit # PKCS#11模块加载库 + pango # 文本布局和渲染库 + pixman # 像素操作库 + python3 # Python编程语言解释器 + speex # 语音压缩格式 + stdenv.cc.cc # 标准C编译器 + tbb # 英特尔线程构建块库 + udev # 设备管理器 + vulkan-loader # Vulkan图形API加载器 + wayland # 显示服务器协议 + xorg.libICE # X11 Inter-Client Exchange库 + xorg.libSM # X11会话管理库 + xorg.libX11 # X11客户端库 + xorg.libXScrnSaver # X11屏幕保护扩展库 + xorg.libXcomposite # X11合成扩展库 + xorg.libXcursor # X11光标管理库 + xorg.libXdamage # X11损坏扩展库 + xorg.libXext # X11通用扩展库 + xorg.libXfixes # X11修复扩展库 + xorg.libXft # X11 FreeType接口库 + xorg.libXi # X11输入扩展库 + xorg.libXinerama # X11多显示器扩展库 + xorg.libXmu # X11杂项实用工具库 + xorg.libXrandr # X11调整大小和旋转扩展库 + xorg.libXrender # X11渲染扩展库 + xorg.libXt # X11工具包内省库 + xorg.libXtst # X11测试扩展库 + xorg.libXxf86vm # X11 XFree86视频模式扩展库 + xorg.libpciaccess # X11 PCI访问库 + xorg.libxcb # X11 C绑定库 + xorg.xcbutil # XCB实用工具库 + xorg.xcbutilimage # XCB图像实用工具库 + xorg.xcbutilkeysyms # XCB键符号实用工具库 + xorg.xcbutilrenderutil # XCB渲染实用工具库 + xorg.xcbutilwm # XCB窗口管理实用工具库 + xorg.xkeyboardconfig # X11键盘配置数据库 + xz # LZMA压缩工具 + zlib # 通用数据压缩库 + ]; + }; + }; +} diff --git a/modules/nixos/core/system.nix b/modules/nixos/core/system.nix index e108a45..edb751b 100644 --- a/modules/nixos/core/system.nix +++ b/modules/nixos/core/system.nix @@ -23,6 +23,7 @@ }; }; + # Enable the Avahi daemon for mDNS/DNS-SD support avahi = { enable = true; nssmdns4 = true; # 非常重要,允许系统解析 .local 地址 diff --git a/modules/nixos/virtualize/docker.nix b/modules/nixos/virtualize/docker.nix index 56cc2d9..184e774 100644 --- a/modules/nixos/virtualize/docker.nix +++ b/modules/nixos/virtualize/docker.nix @@ -4,6 +4,16 @@ virtualisation.docker = { enable = true; storageDriver = "btrfs"; + daemon.settings = { + userland-proxy = false; + experimental = true; + ipv6 = true; + fixed-cidr-v6 = "fd00::/80"; + metrics-addr = "0.0.0.0:9323"; + log-driver = "json-file"; + log-opts.max-size = "10m"; + log-opts.max-file = "3"; + }; }; # Enable Podman