From 7a246f4e5e392cef547e0a993815dd7128d8be9d Mon Sep 17 00:00:00 2001 From: Bun Date: Thu, 8 May 2025 09:27:18 -0400 Subject: [PATCH 1/4] Simplify font logic --- modules/home/programs/gui/foot/default.nix | 2 +- .../home/programs/gui/librewolf/default.nix | 8 ++--- modules/home/settings/fonts/default.nix | 31 +++++++++---------- modules/home/settings/gtk/theme/default.nix | 2 +- modules/home/variables/look/default.nix | 1 - modules/home/variables/look/fonts/default.nix | 11 ------- modules/home/wms/programs/rofi/default.nix | 2 +- .../home/wms/programs/swaylock/default.nix | 2 +- modules/home/wms/programs/waybar/default.nix | 2 +- modules/home/wms/sway/theme/default.nix | 2 +- 10 files changed, 25 insertions(+), 38 deletions(-) delete mode 100644 modules/home/variables/look/fonts/default.nix diff --git a/modules/home/programs/gui/foot/default.nix b/modules/home/programs/gui/foot/default.nix index c91dc8e9..ba7df0b3 100644 --- a/modules/home/programs/gui/foot/default.nix +++ b/modules/home/programs/gui/foot/default.nix @@ -6,7 +6,7 @@ settings = { main = { term = "xterm-256color"; - font = "${config.look.fonts.nerd}:size=14.7"; + font = "${config.fonts.fontconfig.defaultFonts.monospace}:size=14.7"; }; colors = { alpha = "0.85"; diff --git a/modules/home/programs/gui/librewolf/default.nix b/modules/home/programs/gui/librewolf/default.nix index 136c711f..efd67215 100644 --- a/modules/home/programs/gui/librewolf/default.nix +++ b/modules/home/programs/gui/librewolf/default.nix @@ -7,8 +7,8 @@ profiles = let # FireFox css, based on https://github.com/Dook97/firefox-qutebrowser-userchrome themeFont = '' - --tab-font: '${config.look.fonts.main}'; - --urlbar-font: '${config.look.fonts.main}'; + --tab-font: '${config.fonts.fontconfig.defaultFonts.sansSerif}'; + --urlbar-font: '${config.fonts.fontconfig.defaultFonts.sansSerif}'; ''; themeMain = '' :root { @@ -121,8 +121,8 @@ "webgl.disabled" = false; # Fonts - "font.name.serif.x-western" = config.look.fonts.main; - "font.name.sans-serif.x-western" = config.look.fonts.main; + "font.name.serif.x-western" = config.fonts.fontconfig.defaultFonts.sansSerif; + "font.name.sans-serif.x-western" = config.fonts.fontconfig.defaultFonts.sansSerif; "font.name.monospace.x-western" = config.look.fonts.nerd; # Theming and visibility diff --git a/modules/home/settings/fonts/default.nix b/modules/home/settings/fonts/default.nix index 8f52ecaa..e96d77e0 100644 --- a/modules/home/settings/fonts/default.nix +++ b/modules/home/settings/fonts/default.nix @@ -1,21 +1,20 @@ { config, lib, pkgsStable, ... }: { - config = lib.mkIf config.home.desktop.enable { - home.packages = with pkgsStable; [ - liberation_ttf - twitter-color-emoji - noto-fonts - sarasa-gothic - ubuntu_font_family - (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) - ]; - fonts.fontconfig = { - enable = true; - defaultFonts = { - sansSerif = [ "Ubuntu" ]; - monospace = [ "UbuntuMono Nerd Font Mono" ]; - emoji = [ "Twitter Color Emoji" ]; - }; + home.packages = lib.mkIf config.home.desktop.enable (with pkgsStable; [ + liberation_ttf + twitter-color-emoji + noto-fonts + sarasa-gothic + ubuntu_font_family + (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) + ]); + + fonts.fontconfig = { + enable = config.home.desktop.enable; + defaultFonts = { + sansSerif = [ "Ubuntu" ]; + monospace = [ "UbuntuMono Nerd Font Mono" ]; + emoji = [ "Twitter Color Emoji" ]; }; }; } diff --git a/modules/home/settings/gtk/theme/default.nix b/modules/home/settings/gtk/theme/default.nix index 34918d00..f02b5b5a 100644 --- a/modules/home/settings/gtk/theme/default.nix +++ b/modules/home/settings/gtk/theme/default.nix @@ -2,7 +2,7 @@ { gtk = with pkgs; { font = { - name = config.look.fonts.main; + name = config.fonts.fontconfig.defaultFonts.sansSerif; size = 11; }; theme = { diff --git a/modules/home/variables/look/default.nix b/modules/home/variables/look/default.nix index a5930b9c..e507057e 100644 --- a/modules/home/variables/look/default.nix +++ b/modules/home/variables/look/default.nix @@ -3,6 +3,5 @@ imports = [ ./border ./colors - ./fonts ]; } diff --git a/modules/home/variables/look/fonts/default.nix b/modules/home/variables/look/fonts/default.nix deleted file mode 100644 index 3f56b733..00000000 --- a/modules/home/variables/look/fonts/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, lib, ... }: -{ - options.look.fonts = lib.mkOption { - type = lib.types.attrs; - }; - - config.look.fonts = { - main = "Ubuntu"; - nerd = "UbuntuMono Nerd Font"; - }; -} diff --git a/modules/home/wms/programs/rofi/default.nix b/modules/home/wms/programs/rofi/default.nix index a32f7076..029a4922 100644 --- a/modules/home/wms/programs/rofi/default.nix +++ b/modules/home/wms/programs/rofi/default.nix @@ -7,7 +7,7 @@ enable = true; package = pkgs.rofi-wayland; terminal = "foot"; - font = "${config.look.fonts.main} 14"; + font = "${config.fonts.fontconfig.defaultFonts.sansSerif} 14"; theme = let inherit (config.lib.formats.rasi) mkLiteral; in { diff --git a/modules/home/wms/programs/swaylock/default.nix b/modules/home/wms/programs/swaylock/default.nix index 52c358c5..367c4842 100644 --- a/modules/home/wms/programs/swaylock/default.nix +++ b/modules/home/wms/programs/swaylock/default.nix @@ -13,7 +13,7 @@ in { settings = { clock = true; image = "~/.assets/lockscreen/lock.png"; - font = config.look.fonts.main; + font = config.fonts.fontconfig.defaultFonts.sansSerif; font-size = 30; timestr = "%I:%M%p"; datestr = "%a %b %d %Y"; diff --git a/modules/home/wms/programs/waybar/default.nix b/modules/home/wms/programs/waybar/default.nix index 46243893..9d1b9e6f 100644 --- a/modules/home/wms/programs/waybar/default.nix +++ b/modules/home/wms/programs/waybar/default.nix @@ -300,7 +300,7 @@ border: 0; border-radius: 0; min-height: 0; - font-family: ${config.look.fonts.main}, ${config.look.fonts.nerd}; + font-family: ${config.fonts.fontconfig.defaultFonts.sansSerif}, ${config.fonts.fontconfig.defaultFonts.monospace}; font-size: 15.5px; color: #${config.look.colors.text}; } diff --git a/modules/home/wms/sway/theme/default.nix b/modules/home/wms/sway/theme/default.nix index d6184ecf..7354a95a 100644 --- a/modules/home/wms/sway/theme/default.nix +++ b/modules/home/wms/sway/theme/default.nix @@ -32,7 +32,7 @@ }; }; fonts = { - names = [ config.look.fonts.main ]; + names = [ config.fonts.fontconfig.defaultFonts.sansSerif ]; size = 10.5; }; window = { From c4b63c47966af948b7449446a70500132b408c4c Mon Sep 17 00:00:00 2001 From: Bun Date: Thu, 8 May 2025 10:55:26 -0400 Subject: [PATCH 2/4] Move gpg to its own service --- modules/home/programs/terminal/git/default.nix | 5 +---- modules/home/services/default.nix | 1 + modules/home/services/gpg/default.nix | 7 +++++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 modules/home/services/gpg/default.nix diff --git a/modules/home/programs/terminal/git/default.nix b/modules/home/programs/terminal/git/default.nix index 789a8421..8953b925 100644 --- a/modules/home/programs/terminal/git/default.nix +++ b/modules/home/programs/terminal/git/default.nix @@ -7,8 +7,5 @@ extraConfig.safe.directory = "/etc/nixos"; }; - home.packages = with pkgs; [ - git-crypt - gnupg - ]; + home.packages = with pkgs; [ git-crypt ]; } diff --git a/modules/home/services/default.nix b/modules/home/services/default.nix index 7a788ba1..8bbdeef3 100644 --- a/modules/home/services/default.nix +++ b/modules/home/services/default.nix @@ -2,6 +2,7 @@ { imports = [ ./easyeffects + ./gpg ./mpd ./playerctl ]; diff --git a/modules/home/services/gpg/default.nix b/modules/home/services/gpg/default.nix new file mode 100644 index 00000000..a6cbd32b --- /dev/null +++ b/modules/home/services/gpg/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.gpg-agent = { + enable = true; + enableSshSupport = true; + }; +} From 01d16e03c8310c3f069401b69b589f61a0e00eb0 Mon Sep 17 00:00:00 2001 From: Bun Date: Thu, 8 May 2025 10:55:26 -0400 Subject: [PATCH 3/4] Move gpg to its own service --- modules/home/programs/terminal/git/default.nix | 5 +---- modules/home/services/default.nix | 1 + modules/home/services/gpg/default.nix | 7 +++++++ 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 modules/home/services/gpg/default.nix diff --git a/modules/home/programs/terminal/git/default.nix b/modules/home/programs/terminal/git/default.nix index 789a8421..8953b925 100644 --- a/modules/home/programs/terminal/git/default.nix +++ b/modules/home/programs/terminal/git/default.nix @@ -7,8 +7,5 @@ extraConfig.safe.directory = "/etc/nixos"; }; - home.packages = with pkgs; [ - git-crypt - gnupg - ]; + home.packages = with pkgs; [ git-crypt ]; } diff --git a/modules/home/services/default.nix b/modules/home/services/default.nix index 7a788ba1..8bbdeef3 100644 --- a/modules/home/services/default.nix +++ b/modules/home/services/default.nix @@ -2,6 +2,7 @@ { imports = [ ./easyeffects + ./gpg ./mpd ./playerctl ]; diff --git a/modules/home/services/gpg/default.nix b/modules/home/services/gpg/default.nix new file mode 100644 index 00000000..a6cbd32b --- /dev/null +++ b/modules/home/services/gpg/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.gpg-agent = { + enable = true; + enableSshSupport = true; + }; +} From 74b2840bf7e641f770f87d8949d5c15028dc9573 Mon Sep 17 00:00:00 2001 From: Bun Date: Thu, 8 May 2025 13:08:32 -0400 Subject: [PATCH 4/4] Change font variables and simplify and standardize logic and formatting --- modules/home/programs/gui/foot/default.nix | 2 +- .../home/programs/gui/librewolf/default.nix | 2 +- modules/home/settings/dconf/default.nix | 4 +--- modules/home/settings/fonts/default.nix | 24 ++++--------------- .../settings/fonts/fontconfig/default.nix | 11 +++++++++ .../home/settings/fonts/packages/default.nix | 11 +++++++++ modules/home/settings/gtk/default.nix | 2 +- modules/home/variables/look/fonts/default.nix | 2 +- modules/home/wms/programs/waybar/default.nix | 2 +- 9 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 modules/home/settings/fonts/fontconfig/default.nix create mode 100644 modules/home/settings/fonts/packages/default.nix diff --git a/modules/home/programs/gui/foot/default.nix b/modules/home/programs/gui/foot/default.nix index c91dc8e9..27f704d5 100644 --- a/modules/home/programs/gui/foot/default.nix +++ b/modules/home/programs/gui/foot/default.nix @@ -6,7 +6,7 @@ settings = { main = { term = "xterm-256color"; - font = "${config.look.fonts.nerd}:size=14.7"; + font = "${config.look.fonts.mono}:size=14.7"; }; colors = { alpha = "0.85"; diff --git a/modules/home/programs/gui/librewolf/default.nix b/modules/home/programs/gui/librewolf/default.nix index 136c711f..8f5291be 100644 --- a/modules/home/programs/gui/librewolf/default.nix +++ b/modules/home/programs/gui/librewolf/default.nix @@ -123,7 +123,7 @@ # Fonts "font.name.serif.x-western" = config.look.fonts.main; "font.name.sans-serif.x-western" = config.look.fonts.main; - "font.name.monospace.x-western" = config.look.fonts.nerd; + "font.name.monospace.x-western" = config.look.fonts.mono; # Theming and visibility "browser.aboutConfig.showWarning" = false; diff --git a/modules/home/settings/dconf/default.nix b/modules/home/settings/dconf/default.nix index 9e04e03f..38cda938 100644 --- a/modules/home/settings/dconf/default.nix +++ b/modules/home/settings/dconf/default.nix @@ -2,9 +2,7 @@ { config = lib.mkIf config.home.desktop.enable { dconf.settings = { - "org/gnome/desktop/interface/color-scheme" = { - color-scheme = "prefer-dark"; - }; + "org/gnome/desktop/interface/color-scheme".color-scheme = "prefer-dark"; "org/virt-manager/virt-manager/connections" = { autoconnect = [ "qemu:///system" ]; uris = [ "qemu:///system" ]; diff --git a/modules/home/settings/fonts/default.nix b/modules/home/settings/fonts/default.nix index 8f52ecaa..644410bf 100644 --- a/modules/home/settings/fonts/default.nix +++ b/modules/home/settings/fonts/default.nix @@ -1,21 +1,7 @@ -{ config, lib, pkgsStable, ... }: +{ ... }: { - config = lib.mkIf config.home.desktop.enable { - home.packages = with pkgsStable; [ - liberation_ttf - twitter-color-emoji - noto-fonts - sarasa-gothic - ubuntu_font_family - (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) - ]; - fonts.fontconfig = { - enable = true; - defaultFonts = { - sansSerif = [ "Ubuntu" ]; - monospace = [ "UbuntuMono Nerd Font Mono" ]; - emoji = [ "Twitter Color Emoji" ]; - }; - }; - }; + imports = [ + ./fontconfig + ./packages + ]; } diff --git a/modules/home/settings/fonts/fontconfig/default.nix b/modules/home/settings/fonts/fontconfig/default.nix new file mode 100644 index 00000000..0ad9bae1 --- /dev/null +++ b/modules/home/settings/fonts/fontconfig/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + fonts.fontconfig = { + enable = config.home.desktop.enable; + defaultFonts = { + sansSerif = [ config.look.fonts.main ]; + monospace = [ config.look.fonts.mono ]; + emoji = [ "Twitter Color Emoji" ]; + }; + }; +} diff --git a/modules/home/settings/fonts/packages/default.nix b/modules/home/settings/fonts/packages/default.nix new file mode 100644 index 00000000..d7cae882 --- /dev/null +++ b/modules/home/settings/fonts/packages/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgsStable, ... }: +{ + home.packages = lib.mkIf config.home.desktop.enable (with pkgsStable; [ + liberation_ttf + twitter-color-emoji + noto-fonts + sarasa-gothic + ubuntu_font_family + (nerdfonts.override { fonts = [ "UbuntuMono" ]; }) + ]); +} diff --git a/modules/home/settings/gtk/default.nix b/modules/home/settings/gtk/default.nix index 65c04c12..a31cec5c 100644 --- a/modules/home/settings/gtk/default.nix +++ b/modules/home/settings/gtk/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: { imports = [ ./bookmarks diff --git a/modules/home/variables/look/fonts/default.nix b/modules/home/variables/look/fonts/default.nix index 3f56b733..b8cc234c 100644 --- a/modules/home/variables/look/fonts/default.nix +++ b/modules/home/variables/look/fonts/default.nix @@ -6,6 +6,6 @@ config.look.fonts = { main = "Ubuntu"; - nerd = "UbuntuMono Nerd Font"; + mono = "UbuntuMono Nerd Font"; }; } diff --git a/modules/home/wms/programs/waybar/default.nix b/modules/home/wms/programs/waybar/default.nix index 46243893..ba2d3f12 100644 --- a/modules/home/wms/programs/waybar/default.nix +++ b/modules/home/wms/programs/waybar/default.nix @@ -300,7 +300,7 @@ border: 0; border-radius: 0; min-height: 0; - font-family: ${config.look.fonts.main}, ${config.look.fonts.nerd}; + font-family: ${config.look.fonts.main}, ${config.look.fonts.mono}; font-size: 15.5px; color: #${config.look.colors.text}; }