From 6e258fc0236f7af28883a554ea60e736a6889e9a Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Tue, 25 Mar 2025 06:07:17 +0800 Subject: [PATCH] refactor(stylix): add home-manager integration --- systems/modules/fonts/sauce-code-pro.nix | 29 ------------------- systems/modules/stylix.nix | 8 +++-- {systems/modules/themes => themes}/3024.nix | 0 .../modules/themes => themes}/black-metal.nix | 0 {systems/modules/themes => themes}/bright.nix | 0 .../themes => themes}/catppuccin-mocha.nix | 0 .../cursors/banana-cursor.nix | 0 .../modules => themes}/cursors/wii-cursor.nix | 0 .../modules/themes => themes}/darkviolet.nix | 0 {systems/modules => themes}/fonts/0xProto.nix | 0 {systems/modules => themes}/fonts/3270.nix | 0 themes/fonts/sauce-code-pro.nix | 21 ++++++++++++++ .../modules => themes}/fonts/terminess.nix | 0 users/modules/programs/nvf/languages.nix | 1 + users/modules/stylix.nix | 16 ++++++++++ users/rafiq.nix | 10 ++++++- 16 files changed, 52 insertions(+), 33 deletions(-) delete mode 100644 systems/modules/fonts/sauce-code-pro.nix rename {systems/modules/themes => themes}/3024.nix (100%) rename {systems/modules/themes => themes}/black-metal.nix (100%) rename {systems/modules/themes => themes}/bright.nix (100%) rename {systems/modules/themes => themes}/catppuccin-mocha.nix (100%) rename {systems/modules => themes}/cursors/banana-cursor.nix (100%) rename {systems/modules => themes}/cursors/wii-cursor.nix (100%) rename {systems/modules/themes => themes}/darkviolet.nix (100%) rename {systems/modules => themes}/fonts/0xProto.nix (100%) rename {systems/modules => themes}/fonts/3270.nix (100%) create mode 100644 themes/fonts/sauce-code-pro.nix rename {systems/modules => themes}/fonts/terminess.nix (100%) create mode 100644 users/modules/stylix.nix diff --git a/systems/modules/fonts/sauce-code-pro.nix b/systems/modules/fonts/sauce-code-pro.nix deleted file mode 100644 index eca123f..0000000 --- a/systems/modules/fonts/sauce-code-pro.nix +++ /dev/null @@ -1,29 +0,0 @@ -{pkgs, ...}: { - fonts.packages = with pkgs; [ - nerd-fonts.sauce-code-pro - ]; - stylix.fonts = { - serif = { - package = pkgs.nerd-fonts.terminess-ttf; - name = "SauceCodePro Nerd Font"; - }; - sansSerif = { - package = pkgs.nerd-fonts.terminess-ttf; - name = "SauceCodePro Nerd Font"; - }; - emoji = { - package = pkgs.nerd-fonts.terminess-ttf; - name = "SauceCodePro Nerd Font"; - }; - monospace = { - package = pkgs.nerd-fonts.terminess-ttf; - name = "SauceCodePro Nerd Font Mono"; - }; - sizes = { - applications = 16; - desktop = 12; - popups = 12; - terminal = 16; - }; - }; -} diff --git a/systems/modules/stylix.nix b/systems/modules/stylix.nix index 3c7d6a1..7a75a95 100644 --- a/systems/modules/stylix.nix +++ b/systems/modules/stylix.nix @@ -2,12 +2,14 @@ { imports = [ inputs.stylix.nixosModules.stylix - ./themes/darkviolet.nix - ./fonts/sauce-code-pro.nix - ./cursors/banana-cursor.nix + ../../themes/darkviolet.nix + ../../themes/fonts/sauce-code-pro.nix + ../../themes/cursors/banana-cursor.nix ]; stylix = { enable = true; image = ../../media/wallpaper.jpg; + homeManagerIntegration.autoImport = false; + homeManagerIntegration.followSystem = false; }; } diff --git a/systems/modules/themes/3024.nix b/themes/3024.nix similarity index 100% rename from systems/modules/themes/3024.nix rename to themes/3024.nix diff --git a/systems/modules/themes/black-metal.nix b/themes/black-metal.nix similarity index 100% rename from systems/modules/themes/black-metal.nix rename to themes/black-metal.nix diff --git a/systems/modules/themes/bright.nix b/themes/bright.nix similarity index 100% rename from systems/modules/themes/bright.nix rename to themes/bright.nix diff --git a/systems/modules/themes/catppuccin-mocha.nix b/themes/catppuccin-mocha.nix similarity index 100% rename from systems/modules/themes/catppuccin-mocha.nix rename to themes/catppuccin-mocha.nix diff --git a/systems/modules/cursors/banana-cursor.nix b/themes/cursors/banana-cursor.nix similarity index 100% rename from systems/modules/cursors/banana-cursor.nix rename to themes/cursors/banana-cursor.nix diff --git a/systems/modules/cursors/wii-cursor.nix b/themes/cursors/wii-cursor.nix similarity index 100% rename from systems/modules/cursors/wii-cursor.nix rename to themes/cursors/wii-cursor.nix diff --git a/systems/modules/themes/darkviolet.nix b/themes/darkviolet.nix similarity index 100% rename from systems/modules/themes/darkviolet.nix rename to themes/darkviolet.nix diff --git a/systems/modules/fonts/0xProto.nix b/themes/fonts/0xProto.nix similarity index 100% rename from systems/modules/fonts/0xProto.nix rename to themes/fonts/0xProto.nix diff --git a/systems/modules/fonts/3270.nix b/themes/fonts/3270.nix similarity index 100% rename from systems/modules/fonts/3270.nix rename to themes/fonts/3270.nix diff --git a/themes/fonts/sauce-code-pro.nix b/themes/fonts/sauce-code-pro.nix new file mode 100644 index 0000000..f88e6ad --- /dev/null +++ b/themes/fonts/sauce-code-pro.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + stylix.fonts = { + # packages = [ pkgs.nerd-fonts.sauce-code-pro ]; + emoji.name = "SauceCodePro Nerd Font"; + emoji.package = pkgs.nerd-fonts.sauce-code-pro; + monospace.name = "SauceCodePro Nerd Font Mono"; + monospace.package = pkgs.nerd-fonts.sauce-code-pro; + sansSerif.name = "SauceCodePro Nerd Font"; + sansSerif.package = pkgs.nerd-fonts.sauce-code-pro; + serif.name = "SauceCodePro Nerd Font"; + serif.package = pkgs.nerd-fonts.sauce-code-pro; + + sizes = { + applications = 16; + desktop = 12; + popups = 12; + terminal = 16; + }; + }; +} diff --git a/systems/modules/fonts/terminess.nix b/themes/fonts/terminess.nix similarity index 100% rename from systems/modules/fonts/terminess.nix rename to themes/fonts/terminess.nix diff --git a/users/modules/programs/nvf/languages.nix b/users/modules/programs/nvf/languages.nix index 5540fc0..50a4ff3 100644 --- a/users/modules/programs/nvf/languages.nix +++ b/users/modules/programs/nvf/languages.nix @@ -14,5 +14,6 @@ clang.enable = true; lua.enable = true; python.enable = true; + css.enable = true; }; } diff --git a/users/modules/stylix.nix b/users/modules/stylix.nix new file mode 100644 index 0000000..e2a8949 --- /dev/null +++ b/users/modules/stylix.nix @@ -0,0 +1,16 @@ +{ inputs, pkgs, ... }: +{ + imports = [ + inputs.stylix.homeManagerModules.stylix + ../../themes/darkviolet.nix + ../../themes/fonts/sauce-code-pro.nix + ../../themes/cursors/banana-cursor.nix + ]; + stylix = { + enable = true; + image = ../../media/wallpaper.jpg; + }; + stylix.targets.gtk.extraCss = '' + + ''; +} diff --git a/users/rafiq.nix b/users/rafiq.nix index a30a46c..a18f8a0 100644 --- a/users/rafiq.nix +++ b/users/rafiq.nix @@ -1,8 +1,15 @@ -{pkgs, ...}: { +{ + pkgs, + inputs, + lib, + ... +}: +{ imports = [ ./modules/sh.nix ./modules/de.nix ./modules/utils.nix + ./modules/stylix.nix ]; # This enables using home-manager from the command line. @@ -17,4 +24,5 @@ # Do not change it. stateVersion = "25.05"; }; + }