diff --git a/flake.nix b/flake.nix index ac535f6..8824b19 100644 --- a/flake.nix +++ b/flake.nix @@ -16,6 +16,11 @@ }; flox.url = "github:flox/flox"; hyprland.url = "github:hyprwm/Hyprland"; + + stylix = { + url = "github:nix-community/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = @@ -27,6 +32,7 @@ rust-overlay, flox, hyprland, + stylix, ... }: let @@ -71,6 +77,7 @@ overlays primaryUser hyprland # Pass hyprland to specialArgs + stylix ; unstablePkgs = import nixpkgs-unstable { inherit system; }; }; @@ -96,6 +103,7 @@ home-manager.users.death916 = { imports = [ ./home-manager/home.nix + stylix.homeManagerModules.stylix ]; }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 7083820..e68980d 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -16,6 +16,7 @@ in imports = [ ../modules/home-manager/common.nix ./hyprland.nix # Add this line to import your Hyprland configuration + ./theme.nix # Import the stylix theme configuration ]; home.username = "death916"; diff --git a/home-manager/hyprland.nix b/home-manager/hyprland.nix index 99f8276..f9d8e57 100644 --- a/home-manager/hyprland.nix +++ b/home-manager/hyprland.nix @@ -25,7 +25,8 @@ "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" "swww init &" "waybar &" - "swww img /home/death916/Pictures/wallpapers/jameswebb1.jpg &" + # Stylix will manage the wallpaper + # "swww img /home/death916/Pictures/wallpapers/jameswebb1.jpg &" "dunst &" "nm-applet --indicator &" "blueman-applet &" @@ -35,8 +36,9 @@ gaps_in = 5; gaps_out = 10; border_size = 2; - "col.active_border" = "rgba(cba6f7ee) rgba(1e66f5ee) 45deg"; - "col.inactive_border" = "rgba(313244aa)"; + # Stylix will manage these + # "col.active_border" = "rgba(cba6f7ee) rgba(1e66f5ee) 45deg"; + # "col.inactive_border" = "rgba(313244aa)"; layout = "dwindle"; }; @@ -287,120 +289,16 @@ }; }; }; - style = '' - @define-color rosewater #f5e0dc; - @define-color flamingo #f2cdcd; - @define-color pink #f5c2e7; - @define-color mauve #cba6f7; - @define-color red #f38ba8; - @define-color maroon #eba0ac; - @define-color peach #fab387; - @define-color yellow #f9e2af; - @define-color green #a6e3a1; - @define-color teal #94e2d5; - @define-color sky #89dceb; - @define-color sapphire #74c7ec; - @define-color blue #89b4fa; - @define-color lavender #b4befe; - - @define-color text #cdd6f4; - @define-color subtext1 #bac2de; - @define-color subtext0 #a6adc8; - @define-color overlay2 #9399b2; - @define-color overlay1 #7f849c; - @define-color overlay0 #6c7086; - @define-color surface2 #585b70; - @define-color surface1 #45475a; - @define-color surface0 #313244; - @define-color base #1e1e2e; - @define-color mantle #181825; - @define-color crust #11111b; - - * { - font-family: "JetBrainsMono Nerd Font", FontAwesome, Roboto, Helvetica, Arial, sans-serif; - font-size: 13px; - } - - window#waybar { - background-color: rgba(17, 17, 27, 0.5); - color: @text; - } - - #workspaces button { - padding: 0 5px; - background-color: transparent; - color: @overlay1; - border-radius: 0; - } - - #workspaces button.active { - color: @lavender; - border-bottom: 2px solid @lavender; - } - - #workspaces button:hover { - background-color: @surface0; - } - - #clock, #battery, #cpu, #memory, #network, #pulseaudio, #tray, #window { - padding: 0 10px; - margin: 3px 4px; - border-radius: 8px; - background-color: @mantle; - } - - #clock { - background-color: @crust; - color: @text; - } - - #battery { - background-color: @crust; - color: @text; - } - - #battery.charging, #battery.plugged { - background-color: @green; - } - - #cpu { - background-color: @crust; - color: @text; - } - - #memory { - background-color: @crust; - color: @text; - } - - #network { - background-color: @crust; - color: @text; - } - - #pulseaudio { - background-color: @crust; - color: @text; - } - - #pulseaudio.muted { - background-color: @surface1; - } - - #custom-wttrbar { - background-color: @crust; - color: @text; - } - ''; + style = config.stylix.waybar.css; }; programs.rofi = { enable = true; - theme = "arthur"; + theme = config.stylix.rofi.theme; extraConfig = { modi = "drun,run,ssh,window"; show-icons = true; - icon-theme = "Papirus-Dark"; + icon-theme = "Papirus-Dark"; # This might be overridden by stylix, but it's good to keep }; }; @@ -425,7 +323,7 @@ padding = 8; horizontal_padding = 8; frame_width = 2; - frame_color = "#cba6f7"; + frame_color = config.stylix.colors.base0C; # Blue accent separator_color = "frame"; word_wrap = true; ellipsize = "middle"; @@ -455,16 +353,16 @@ show_indicators = true; }; urgency_low = { - background = "#1e1e2e"; - foreground = "#cdd6f4"; + background = config.stylix.colors.base00; + foreground = config.stylix.colors.base05; }; urgency_normal = { - background = "#1e1e2e"; - foreground = "#cdd6f4"; + background = config.stylix.colors.base00; + foreground = config.stylix.colors.base05; }; urgency_critical = { - background = "#f38ba8"; - foreground = "#1e1e2e"; + background = config.stylix.colors.base08; # Red accent + foreground = config.stylix.colors.base00; }; }; }; @@ -473,44 +371,6 @@ enable = true; }; - gtk = { - enable = true; - gtk3 = { - extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - }; - - gtk4 = { - extraConfig = { - gtk-application-prefer-dark-theme = 1; - }; - }; - - theme = { - name = "Materia-dark"; - package = pkgs.materia-theme; - }; - iconTheme = { - name = "Papirus-Dark"; - package = pkgs.papirus-icon-theme; - }; - cursorTheme = { - name = "Catppuccin-Mocha-Dark-Cursors"; - package = pkgs.catppuccin-cursors; - size = 24; - }; - }; - - qt = { - enable = true; - platformTheme.name = "qt5ct"; - }; - - home.sessionVariables = { - QT_STYLE_OVERRIDE = "qt5ct"; - }; - fonts.fontconfig.enable = true; home.packages = with pkgs; [ nerd-fonts.jetbrains-mono diff --git a/home-manager/theme.nix b/home-manager/theme.nix new file mode 100644 index 0000000..d00afe7 --- /dev/null +++ b/home-manager/theme.nix @@ -0,0 +1,108 @@ +{ config, pkgs, ... }: + +{ + stylix.enable = true; + + stylix.wallpaper.paths = [ "/home/death916/Pictures/wallpapers/jameswebb1.jpg" ]; + stylix.wallpaper.mode = "fill"; # Or "stretch", "zoom", "fit" + + stylix.colors = { + # Base colors (dark to light) + base00 = "#0f0f0f"; # background + base01 = "#1a1a1a"; # slightly lighter background for elements (generated) + base02 = "#706a6a"; # bright_black (for secondary elements, borders) + base03 = "#808080"; # comments/less prominent text (generated) + base04 = "#b0b0b0"; # dim foreground (generated) + base05 = "#eadccc"; # foreground + base06 = "#f0f0f0"; # brighter foreground (generated) + base07 = "#ffffff"; # white (pure white for contrast) + + # Accent colors + base08 = "#e25d6c"; # red + base09 = "#f4bb54"; # yellow + base0A = "#e8ab3b"; # cyan + base0B = "#cea37f"; # green + base0C = "#e2be8a"; # blue + base0D = "#e8ab3b"; # cyan (using cyan for purple-ish if needed, or adjust) + base0E = "#ede4c8"; # magenta (using original magenta) + base0F = "#ff8800"; # a generic amber/orange (generated, could be 'yellow') + }; + + stylix.cursor = { + package = pkgs.catppuccin-cursors; # Existing cursor + name = "Catppuccin-Mocha-Dark-Cursors"; # Existing cursor + size = 24; # Existing size + }; + + stylix.fonts = { + monospace = { + package = pkgs.nerd-fonts.jetbrains-mono; + name = "JetBrainsMono Nerd Font"; + size = 10; + }; + serif = { + package = pkgs.noto-fonts; + name = "Noto Serif"; # Placeholder + size = 10; + }; + sansSerif = { + package = pkgs.noto-fonts; + name = "Noto Sans"; # Placeholder + size = 10; + }; + emoji = { + package = pkgs.noto-fonts-color-emoji; + name = "Noto Color Emoji"; + size = 10; + }; + }; + + stylix.targets = { + desktop.enable = true; # Theme desktop environment components + gtk.enable = true; + kde.enable = true; # KDE is for QT applications + plymouth.enable = true; + plasma.enable = true; # For KDE Plasma + }; + + stylix.extraPackageModules = [ + { config, pkgs, ... }: { + programs.hyprland.settings.general.col.active_border = "rgb(${config.stylix.colors.base0C})"; # Blue + programs.hyprland.settings.general.col.inactive_border = "rgb(${config.stylix.colors.base00})"; # Background + } + ]; + + programs.waybar = { + enable = true; + settings = config.stylix.waybar.settings; # Let stylix manage waybar settings + style = config.stylix.waybar.css; # Let stylix generate the CSS + }; + + programs.rofi = { + enable = true; + theme = config.stylix.rofi.theme; # Let stylix manage rofi theme + }; + + services.dunst = { + enable = true; + settings = { + global = { + frame_color = config.stylix.colors.base0C; # Blue accent + background = config.stylix.colors.base00; + foreground = config.stylix.colors.base05; + }; + urgency_low = { + background = config.stylix.colors.base00; + foreground = config.stylix.colors.base05; + }; + urgency_normal = { + background = config.stylix.colors.base00; + foreground = config.stylix.colors.base05; + }; + urgency_critical = { + background = config.stylix.colors.base08; # Red accent + foreground = config.stylix.colors.base00; + }; + }; + }; +}