diff --git a/flake.nix b/flake.nix index 50a14e4f..21b8c714 100644 --- a/flake.nix +++ b/flake.nix @@ -306,7 +306,6 @@ impermanence.url = "github:nix-community/impermanence"; - # modern window compositor hyprland.url = "github:hyprwm/Hyprland/v0.33.1"; # community wayland nixpkgs # nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland"; diff --git a/home/linux/desktop/gtk.nix b/home/linux/desktop/gtk.nix index dd4f9646..debe8514 100644 --- a/home/linux/desktop/gtk.nix +++ b/home/linux/desktop/gtk.nix @@ -3,12 +3,16 @@ config, ... }: { + # If your themes for mouse cursor, icons or windows don’t load correctly, + # try setting them with home.pointerCursor and gtk.theme, + # which enable a bunch of compatibility options that should make the themes load in all situations. + home.pointerCursor = { + gtk.enable = true; + x11.enable = true; package = pkgs.bibata-cursors; name = "Bibata-Modern-Classic"; size = 24; - gtk.enable = true; - x11.enable = true; }; # set dpi for 4k monitor @@ -27,8 +31,9 @@ enable = true; font = { - name = "Roboto"; - package = pkgs.roboto; + name = "Noto Sans"; + package = pkgs.noto-fonts; + size = 11; }; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; diff --git a/home/linux/hyprland/default.nix b/home/linux/hyprland/default.nix index fcd81e0c..cc47788a 100644 --- a/home/linux/hyprland/default.nix +++ b/home/linux/hyprland/default.nix @@ -1,23 +1,25 @@ -{pkgs, hyprland, catppuccin-hyprland, ...}: { +{ + catppuccin-hyprland, + ... +}: { imports = [ - # hyprland.homeManagerModules.default - ./anyrun.nix ./wayland-apps.nix ]; - # wayland.windowManager.hyprland.enable = true; - # hyprland configs, based on https://github.com/notwidow/hyprland - home.file.".config/hypr" = { + xdg.configFile."hypr" = { source = ./hypr-conf; - # copy the scripts directory recursively recursive = true; }; - home.file.".config/hypr/themes".source = "${catppuccin-hyprland}/themes"; + + xdg.configFile."hypr/themes" = { + source = "${catppuccin-hyprland}/themes"; + recursive = true; + }; # music player - mpd - home.file.".config/mpd" = { + xdg.configFile."mpd" = { source = ./mpd; recursive = true; }; @@ -38,5 +40,4 @@ "WLR_NO_HARDWARE_CURSORS" = "1"; "WLR_EGL_NO_MODIFIRES" = "1"; }; - } diff --git a/home/linux/hyprland/hypr-conf/hyprland.conf b/home/linux/hyprland/hypr-conf/hyprland.conf index 9dbf0ec7..f67a28a6 100644 --- a/home/linux/hyprland/hypr-conf/hyprland.conf +++ b/home/linux/hyprland/hypr-conf/hyprland.conf @@ -218,7 +218,15 @@ exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24 # 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对 exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 -exec-once = xrdb -merge ~/.Xresources -# env = GDK_SCALE,2 -env = XCURSOR_SIZE,48 -env = XCURSOR_THEME,"Bibata-Modern-Ice" +-- Fix HiDPI - xwayland +# change monitor to high resolution, the last argument is the scale factor +monitor=,highres,auto,2 + +# unscale XWayland +xwayland { + force_zero_scaling = true +} + +# toolkit-specific scale +env = GDK_SCALE,2 +env = XCURSOR_SIZE,32 diff --git a/home/linux/server-riscv64.nix b/home/linux/server-riscv64.nix index 5c184844..95f506f7 100644 --- a/home/linux/server-riscv64.nix +++ b/home/linux/server-riscv64.nix @@ -16,7 +16,7 @@ # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - stateVersion = "23.05"; + stateVersion = "23.11"; }; # Let Home Manager install and manage itself. diff --git a/hosts/12kingdoms/suzu/default.nix b/hosts/12kingdoms/suzu/default.nix index 37fef182..9dbb7059 100644 --- a/hosts/12kingdoms/suzu/default.nix +++ b/hosts/12kingdoms/suzu/default.nix @@ -58,5 +58,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/idols/ai/default.nix b/hosts/idols/ai/default.nix index 092a94f1..21e91a88 100644 --- a/hosts/idols/ai/default.nix +++ b/hosts/idols/ai/default.nix @@ -60,11 +60,7 @@ # Optionally, you may need to select the appropriate driver version for your specific GPU. # package = config.boot.kernelPackages.nvidiaPackages.stable; - # Modesetting is needed for most Wayland compositors - modesetting.enable = true; - # Use the open source version of the kernel module - # Only available on driver 515.43.04+ - open = false; + modesetting.enable = false; powerManagement.enable = true; }; diff --git a/hosts/idols/kana/default.nix b/hosts/idols/kana/default.nix index 6a577290..53e58db3 100644 --- a/hosts/idols/kana/default.nix +++ b/hosts/idols/kana/default.nix @@ -60,5 +60,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/idols/ruby/default.nix b/hosts/idols/ruby/default.nix index 3986bea3..64349d8b 100644 --- a/hosts/idols/ruby/default.nix +++ b/hosts/idols/ruby/default.nix @@ -60,5 +60,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/rolling_girls/chiaya/default.nix b/hosts/rolling_girls/chiaya/default.nix index 38254602..ef9f2b81 100644 --- a/hosts/rolling_girls/chiaya/default.nix +++ b/hosts/rolling_girls/chiaya/default.nix @@ -65,5 +65,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/rolling_girls/nozomi/default.nix b/hosts/rolling_girls/nozomi/default.nix index e1cdd075..e9a1e801 100644 --- a/hosts/rolling_girls/nozomi/default.nix +++ b/hosts/rolling_girls/nozomi/default.nix @@ -98,5 +98,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/hosts/rolling_girls/yukina/default.nix b/hosts/rolling_girls/yukina/default.nix index 0a1b80bf..bea26624 100644 --- a/hosts/rolling_girls/yukina/default.nix +++ b/hosts/rolling_girls/yukina/default.nix @@ -98,5 +98,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "23.05"; # Did you read the comment? + system.stateVersion = "23.11"; # Did you read the comment? } diff --git a/modules/nixos/core-desktop.nix b/modules/nixos/core-desktop.nix index fe93f5ec..bf7fe184 100644 --- a/modules/nixos/core-desktop.nix +++ b/modules/nixos/core-desktop.nix @@ -209,6 +209,19 @@ }; }; + services.kmscon = { + # Use kmscon as the virtual console instead of gettys. + # kmscon is a kms/dri-based userspace virtual terminal implementation. + # It supports a richer feature set than the standard linux console VT, + # including full unicode support, and when the video card supports drm should be much faster. + enable = true; + fonts = [ { name = "Source Code Pro"; package = pkgs.source-code-pro; } ]; + extraOptions = "--term xterm-256color"; + extraConfig = "font-size=12"; + # Whether to use 3D hardware acceleration to render the console. + hwRender = true; + }; + environment.variables = { # fix https://github.com/NixOS/nixpkgs/issues/238025 TZ = "${config.time.timeZone}"; diff --git a/modules/nixos/hyprland.nix b/modules/nixos/hyprland.nix index c683afa5..69e33acc 100644 --- a/modules/nixos/hyprland.nix +++ b/modules/nixos/hyprland.nix @@ -1,18 +1,12 @@ {pkgs, hyprland, ...}: { ########################################################################################################## # - # NixOS's Configuration for Hyprland Window Manager + # NixOS's Configuration for Wayland based Window Manager # - # i3wm: old and stable, only support X11 - # sway: compatible with i3wm, support Wayland. do not support Nvidia GPU officially. # hyprland: project starts from 2022, support Wayland, envolving fast, good looking, support Nvidia GPU. # ########################################################################################################## - imports = [ - # hyprland.nixosModules.default - ]; - xdg.portal = { enable = true; wlr.enable = true; @@ -46,22 +40,21 @@ programs = { hyprland = { enable = true; - - xwayland = { - enable = true; + package = hyprland.packages.${pkgs.system}.hyprland.override { + enableXWayland = true; # whether to enable XWayland + legacyRenderer = false; # whether to use the legacy renderer (for old GPUs) + withSystemd = true; # whether to build with systemd support }; - - enableNvidiaPatches = true; }; - # monitor backlight control - light.enable = true; - # thunar file manager(part of xfce) related options - thunar.plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; }; # List packages installed in system profile. To search, run: @@ -73,7 +66,7 @@ swaylock # locking the screen wlogout # logout menu wl-clipboard # copying and pasting - hyprpicker # color picker + hyprpicker # color picker wf-recorder # creen recording grim # taking screenshots @@ -90,8 +83,6 @@ mpc-cli # command-line mpd client ncmpcpp # a mpd client with a UI networkmanagerapplet # provide GUI app: nm-connection-editor - - xfce.thunar # xfce4's file manager ]; # fix https://github.com/ryan4yin/nix-config/issues/10 diff --git a/modules/nixos/i3.nix b/modules/nixos/i3.nix index f8efdafd..c019e6cc 100644 --- a/modules/nixos/i3.nix +++ b/modules/nixos/i3.nix @@ -5,22 +5,38 @@ # #################################################################### + programs = { + # thunar file manager(part of xfce) related options + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + }; + # i3 related options - environment.pathsToLink = ["/libexec"]; # links /libexec from derivations to /run/current-system/sw services = { gvfs.enable = true; # Mount, trash, and other functionalities tumbler.enable = true; # Thumbnail support for images xserver = { enable = true; + # Configure keymap in X11 + xkb.layout = "us"; + desktopManager = { xterm.enable = false; }; displayManager = { + lightdm.enable = true; + autoLogin = { + enable = true; + user = "ryan"; + }; defaultSession = "none+i3"; - lightdm.enable = false; - gdm.enable = true; }; windowManager.i3 = { @@ -35,7 +51,7 @@ i3-gaps # i3 with gaps picom # transparency and shadows feh # set wallpaper - xcolor # color picker + xcolor # color picker acpi # battery information arandr # screen layout manager @@ -46,20 +62,8 @@ scrot # minimal screen capture tool, used by i3 blur lock to take a screenshot sysstat # get system information alsa-utils # provides amixer/alsamixer/... - - xfce.thunar # xfce4's file manager ]; }; - - # Configure keymap in X11 - layout = "us"; - xkbVariant = ""; }; }; - - # thunar file manager(part of xfce) related options - programs.thunar.plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; }