From 107349d45a25a302e3416e15b3129be159fa2fe7 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sun, 3 Dec 2023 20:01:38 +0800 Subject: [PATCH] home, theme: split configuations --- .../applications/sway/default.nix | 6 +++ .../graphical/nixos/fonts/default.nix | 22 +++++++++ .../device-type/graphical/nixos/theme.nix | 46 ++----------------- 3 files changed, 33 insertions(+), 41 deletions(-) diff --git a/users/guanranwang/home-manager/applications/sway/default.nix b/users/guanranwang/home-manager/applications/sway/default.nix index b504c29..6659722 100644 --- a/users/guanranwang/home-manager/applications/sway/default.nix +++ b/users/guanranwang/home-manager/applications/sway/default.nix @@ -24,6 +24,12 @@ GTK_IM_MODULE = lib.mkForce "wayland"; # use text-input-v3 }; + dconf.settings = { + "org/gnome/desktop/wm/preferences" = { + "button-layout" = "icon,appmenu:"; # remove csd window buttons + }; + }; + home.packages = with pkgs; [ pamixer brightnessctl diff --git a/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/fonts/default.nix b/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/fonts/default.nix index f54573b..dacb440 100644 --- a/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/fonts/default.nix +++ b/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/fonts/default.nix @@ -15,6 +15,28 @@ }; }; + gtk.font.name = "Sans"; + dconf.settings = { + "org/gnome/desktop/wm/preferences" = { + "titlebar-font" = "Sans Bold"; + }; + "org/gnome/desktop/interface" = { + "document-font-name" = "Sans"; + "monospace-font-name" = "Monospace"; + # "font-name" is unneeded + # https://github.com/nix-community/home-manager/blob/8765d4e38aa0be53cdeee26f7386173e6c65618d/modules/misc/gtk.nix#L237C19-L237C19 + }; + }; + xresources.properties = { + # Fonts + "Xft.autohint" = "0"; + "Xft.lcdfilter" = "lcddefault"; + "Xft.hintstyle" = "hintslight"; + "Xft.hinting" = "1"; + "Xft.antialias" = "1"; + "Xft.rgba" = "rgb"; + }; + home.packages = with pkgs; [ ### Inter inter diff --git a/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/theme.nix b/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/theme.nix index eddde85..c503485 100644 --- a/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/theme.nix +++ b/users/guanranwang/home-manager/profiles/device-type/graphical/nixos/theme.nix @@ -28,56 +28,20 @@ }; }; - ### Font - gtk.font.name = "Sans"; - - ### GTK theme + ### GTK gtk.theme = { name = "adw-gtk3-dark"; package = pkgs.adw-gtk3; }; - - ### Dconf dconf.settings = { - "org/gnome/desktop/wm/preferences" = { - "titlebar-font" = "Sans Bold"; - "button-layout" = "icon,appmenu:"; # remove csd window buttons - }; "org/gnome/desktop/interface" = { - "document-font-name" = "Sans"; - "monospace-font-name" = "Monospace"; - # "font-name" is unneeded - # https://github.com/nix-community/home-manager/blob/8765d4e38aa0be53cdeee26f7386173e6c65618d/modules/misc/gtk.nix#L237C19-L237C19 - "clock-format" = "12h"; "color-scheme" = "prefer-dark"; - - # i want to split dconf but - # - # error: attribute '"org/gnome/desktop/interface"' already defined at /nix/store/cjr3qn1kg0z268dnbmc2vry4sbgqvnvm-source/users/guanranwang/home-manager/nixos/theming.nix:52:5 - # - # at /nix/store/cjr3qn1kg0z268dnbmc2vry4sbgqvnvm-source/users/guanranwang/home-manager/nixos/theming.nix:36:5: - # - # 35| }; - # 36| "org/gnome/desktop/interface" = { - # | ^ - # 37| "document-font-name" = "Sans"; }; }; - # Misc - xresources = { - properties = { - # Fonts - "Xft.autohint" = "0"; - "Xft.lcdfilter" = "lcddefault"; - "Xft.hintstyle" = "hintslight"; - "Xft.hinting" = "1"; - "Xft.antialias" = "1"; - "Xft.rgba" = "rgb"; - }; - extraConfig = - lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight") - (builtins.readFile "${pkgs.vimPlugins.tokyonight-nvim}/extras/xresources/tokyonight_night.Xresources"); - }; + # X11 + xresources.extraConfig = + lib.mkIf (config.myFlake.home-manager.colorScheme == "tokyonight") + (builtins.readFile "${pkgs.vimPlugins.tokyonight-nvim}/extras/xresources/tokyonight_night.Xresources"); }