diff --git a/Droidnix/README.org b/Droidnix/README.org index e58331370..1c82e330b 100644 --- a/Droidnix/README.org +++ b/Droidnix/README.org @@ -593,25 +593,17 @@ This sets the XDG implementation ** =generated/modules/desktop/stylix.nix= This sets the stylix implementation #+BEGIN_SRC nix :tangle generated/modules/desktop/stylix.nix :noweb tangle :mkdirp yes :eval never-html -{ flakeRoot, config, lib, pkgs, ... }: +{ lib, pkgs, flakeRoot, ... }: let - cfg = config.mySystem.desktop.stylix; -in { + username = "henrov"; +in +{ + flake.nixosModules.stylix = { config, pkgs, lib, ... }: - options.mySystem.desktop.stylix.enable = - lib.mkEnableOption "Stylix System Theming"; - - config = lib.mkIf cfg.enable { - - mySystem = { - apps.wallpaper = { - enable = true; - packages = [ "feh" "st" ]; # just symbolic names - }; - }; - - stylix = { + let + # --- Default stylix config --- + stylixCfg = { enable = true; base16Scheme = "${flakeRoot}/assets/system/theming/stylix/catppuccin-mocha.yaml"; @@ -629,7 +621,6 @@ in { package = pkgs.nerd-fonts.fira-code; name = "Fira Code Nerd Font"; }; - sansSerif = { package = pkgs.lato; name = "Lato"; @@ -643,12 +634,29 @@ in { light = "Papirus-Light"; }; }; + in + { + options.mySystem.desktop.stylix.enable = + lib.mkEnableOption "Enable Stylix System Theming"; - home-manager.users.henrov.home.sessionVariables = { - XCURSOR_THEME = config.stylix.cursor.name; - XCURSOR_SIZE = toString config.stylix.cursor.size; - HYPRCURSOR_THEME = config.stylix.cursor.name; - HYPRCURSOR_SIZE = toString config.stylix.cursor.size; + config = lib.mkIf (stylixCfg.enable or false) { + + # --- Desktop / wallpaper packages --- + mySystem.apps.wallpaper = { + enable = true; + packages = [ "feh" "st" ]; + }; + + # --- Stylix theming --- + stylix = stylixCfg; + + # --- Home session variables --- + home-manager.users.${username}.home.sessionVariables = { + XCURSOR_THEME = stylixCfg.cursor.name; + XCURSOR_SIZE = toString stylixCfg.cursor.size; + HYPRCURSOR_THEME = stylixCfg.cursor.name; + HYPRCURSOR_SIZE = toString stylixCfg.cursor.size; + }; }; }; } diff --git a/Droidnix/generated/modules/desktop/stylix.nix b/Droidnix/generated/modules/desktop/stylix.nix index 22befe091..520686902 100644 --- a/Droidnix/generated/modules/desktop/stylix.nix +++ b/Droidnix/generated/modules/desktop/stylix.nix @@ -1,22 +1,14 @@ -{ flakeRoot, config, lib, pkgs, ... }: +{ lib, pkgs, flakeRoot, ... }: let - cfg = config.mySystem.desktop.stylix; -in { + username = "henrov"; +in +{ + flake.nixosModules.stylix = { config, pkgs, lib, ... }: - options.mySystem.desktop.stylix.enable = - lib.mkEnableOption "Stylix System Theming"; - - config = lib.mkIf cfg.enable { - - mySystem = { - apps.wallpaper = { - enable = true; - packages = [ "feh" "st" ]; # just symbolic names - }; - }; - - stylix = { + let + # --- Default stylix config --- + stylixCfg = { enable = true; base16Scheme = "${flakeRoot}/assets/system/theming/stylix/catppuccin-mocha.yaml"; @@ -34,7 +26,6 @@ in { package = pkgs.nerd-fonts.fira-code; name = "Fira Code Nerd Font"; }; - sansSerif = { package = pkgs.lato; name = "Lato"; @@ -48,12 +39,29 @@ in { light = "Papirus-Light"; }; }; + in + { + options.mySystem.desktop.stylix.enable = + lib.mkEnableOption "Enable Stylix System Theming"; - home-manager.users.henrov.home.sessionVariables = { - XCURSOR_THEME = config.stylix.cursor.name; - XCURSOR_SIZE = toString config.stylix.cursor.size; - HYPRCURSOR_THEME = config.stylix.cursor.name; - HYPRCURSOR_SIZE = toString config.stylix.cursor.size; + config = lib.mkIf (stylixCfg.enable or false) { + + # --- Desktop / wallpaper packages --- + mySystem.apps.wallpaper = { + enable = true; + packages = [ "feh" "st" ]; + }; + + # --- Stylix theming --- + stylix = stylixCfg; + + # --- Home session variables --- + home-manager.users.${username}.home.sessionVariables = { + XCURSOR_THEME = stylixCfg.cursor.name; + XCURSOR_SIZE = toString stylixCfg.cursor.size; + HYPRCURSOR_THEME = stylixCfg.cursor.name; + HYPRCURSOR_SIZE = toString stylixCfg.cursor.size; + }; }; }; }