diff --git a/flake.nix b/flake.nix index 81d8cfe1..9078e4ff 100644 --- a/flake.nix +++ b/flake.nix @@ -97,7 +97,9 @@ ({pkgs, config, ... }: { config = { # use it as an overlay - nixpkgs.overlays = [ inputs.nixpkgs-wayland.overlay ]; + nixpkgs.overlays = [ + inputs.nixpkgs-wayland.overlay + ]; }; }) ]; diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index e1f690dc..ce54f5dd 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -10,7 +10,16 @@ recursive = true; }; - home.packages = with pkgs; [ + # allow fontconfig to discover fonts and configurations installed through home.packages + fonts.fontconfig.enable = true; + + home.packages = + let + icomoon-feather-font = pkgs.callPackage ./icomoon-feather-font.nix { }; + in + with pkgs; [ + icomoon-feather-font + waybar # for the status bar swaybg # for setting the wallpaper swayidle # for setting the idle timeout @@ -35,4 +44,15 @@ viewnior # Elegant Image Viewer ]; + + # if use vscode in wayland, uncomment those line + systemd.user.sessionVariables = { + "NIXOS_OZONE_WL" = "1"; # for vscode + # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/ + "LIBVA_DRIVER_NAME" = "nvidia"; + "XDG_SESSION_TYPE" = "wayland"; + "GBM_BACKEND" = "nvidia-drm"; + "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + "WLR_NO_HARDWARE_CURSORS" = "1"; + }; } \ No newline at end of file diff --git a/home/hyprland/hypr-conf/scripts/gtkthemes-bkp b/home/hyprland/hypr-conf/scripts/gtkthemes similarity index 100% rename from home/hyprland/hypr-conf/scripts/gtkthemes-bkp rename to home/hyprland/hypr-conf/scripts/gtkthemes diff --git a/home/hyprland/icomoon-feather-font.nix b/home/hyprland/icomoon-feather-font.nix new file mode 100644 index 00000000..289bf143 --- /dev/null +++ b/home/hyprland/icomoon-feather-font.nix @@ -0,0 +1,34 @@ +{ lib, stdenvNoCC, fetchzip }: + +stdenvNoCC.mkDerivation rec { + pname = "icomoon-feather-font"; + version = "2023-05-06"; + + # 参考 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-icomoon-feather + src = fetchzip { + url = "https://github.com/adi1090x/polybar-themes/archive/47b66337a92a1afd2240ed7094ffcb039cc686cf.zip"; + # sha256 generated by ` nix-prefetch-url --unpack http://...` + sha256 = "1dw7k0ds3z6nkqxi09pjgxl45xcfi2y0khrawxl96hcnawy3qbg8"; + }; + + installPhase = '' + runHook preInstall + + install -Dm644 fonts/feather.ttf -t $out/share/fonts/truetype/ + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://github.com/feathericons/feather"; + description = "Icomoon feather font"; + version = version; + longDescription = '' + Feather is a collection of simply beautiful open source icons. + Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency, and flexibility. + ''; + license = licenses.mit; + maintainers = [ maintainers.ryan4yin ]; + platforms = platforms.all; + }; +} \ No newline at end of file diff --git a/home/programs/vscode.nix b/home/programs/vscode.nix index 02478ed2..6b4105a6 100644 --- a/home/programs/vscode.nix +++ b/home/programs/vscode.nix @@ -7,9 +7,6 @@ }: { - - # if use vscode in wayland, uncomment this line - # environment.sessionVariables.NIXOS_OZONE_WL = "1"; programs.vscode = { enable = true; userSettings = { diff --git a/home/shell/default.nix b/home/shell/default.nix index 4c87e163..81d1f2cd 100644 --- a/home/shell/default.nix +++ b/home/shell/default.nix @@ -11,7 +11,8 @@ in { ]; # add environment variables - home.sessionVariables = { + # 注意不要用 home.sessionVariables 或 home.xxx.sessionVariables,这俩参数没用 + systemd.user.sessionVariables = { # clean up ~ LESSHISTFILE = cache + "/less/history"; LESSKEY = c + "/less/lesskey"; diff --git a/modules/system.nix b/modules/system.nix index e74dbac6..e0b53c50 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -24,9 +24,14 @@ fonts = { + # use fonts specified by user rather than default ones + enableDefaultFonts = false; + fontDir.enable = true; + fonts = with pkgs; [ # icon fonts material-design-icons + font-awesome # normal fonts noto-fonts @@ -39,13 +44,9 @@ "JetBrainsMono" "Iosevka" ];}) - ]; - # use fonts specified by user rather than default ones - enableDefaultFonts = false; - # user defined fonts # the reason there's Noto Color Emoji everywhere is to override DejaVu's # B&W emojis that would sometimes show instead of some Color emojis