From a1bafd78635a8929d03fa124d5975f203edc884e Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Tue, 27 Aug 2024 13:53:48 +0300 Subject: [PATCH] style: stylix --- flake.lock | 281 +++++++++++++++++++++++++- flake.nix | 2 + home-manager/modules/alacritty.nix | 9 +- home-manager/modules/bundle.nix | 2 +- home-manager/modules/cursor.nix | 14 -- home-manager/modules/style.nix | 36 ++++ home-manager/modules/wms/hyprland.nix | 6 +- home-manager/modules/wms/waybar.nix | 116 ++++++----- 8 files changed, 387 insertions(+), 79 deletions(-) delete mode 100644 home-manager/modules/cursor.nix create mode 100644 home-manager/modules/style.nix diff --git a/flake.lock b/flake.lock index 025086f..7a3421a 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,189 @@ { "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "base16-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-foot", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1720809814, + "narHash": "sha256-numb3xigRGnr/deF7wdjBwVg7fpbTH7reFDkJ75AJkY=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "34f41987bec14c0f3f6b2155c19787b1f6489625", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-kitty": { + "flake": false, + "locked": { + "lastModified": 1665001328, + "narHash": "sha256-aRaizTYPpuWEcvoYE9U+YRX+Wsc8+iG0guQJbvxEdJY=", + "owner": "kdrag0n", + "repo": "base16-kitty", + "rev": "06bb401fa9a0ffb84365905ffbb959ae5bf40805", + "type": "github" + }, + "original": { + "owner": "kdrag0n", + "repo": "base16-kitty", + "type": "github" + } + }, + "base16-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "base16-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-tmux", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,13 +204,34 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1724224976, - "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", + "lastModified": 1724479785, + "narHash": "sha256-pP3Azj5d6M5nmG68Fu4JqZmdGt4S4vqI5f8te+E/FTw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", + "rev": "d0e1602ddde669d5beb01aec49d71a51937ed7be", "type": "github" }, "original": { @@ -38,11 +243,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1724316499, - "narHash": "sha256-Qb9MhKBUTCfWg/wqqaxt89Xfi6qTD3XpTzQ9eXi3JmE=", + "lastModified": 1724531977, + "narHash": "sha256-XROVLf9ti4rrNCFLr+DmXRZtPjCQTW4cYy59owTEmxk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "797f7dc49e0bc7fab4b57c021cdf68f595e47841", + "rev": "2527da1ef492c495d5391f3bcf9c1dd9f4514e32", "type": "github" }, "original": { @@ -84,12 +289,29 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1723415338, + "narHash": "sha256-K/BVeDLkpswRSBh3APxc2gBNVFEMXGpnkuQz666FiTM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6e8760f7f7121128e2037db44915a4a5450b6e67", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", - "sops-nix": "sops-nix" + "sops-nix": "sops-nix", + "stylix": "stylix" } }, "sops-nix": { @@ -110,6 +332,51 @@ "repo": "sops-nix", "type": "github" } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-foot": "base16-foot", + "base16-helix": "base16-helix", + "base16-kitty": "base16-kitty", + "base16-tmux": "base16-tmux", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_3", + "systems": "systems" + }, + "locked": { + "lastModified": 1724702977, + "narHash": "sha256-bP1/BHbEigLjTTmqyy1t8w5EVWHuLuABtOd/BBXVLtA=", + "owner": "danth", + "repo": "stylix", + "rev": "6c895c6b42ca205017abe72a7263baf36a197972", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index eed94f9..5039963 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; sops-nix.url = "github:Mic92/sops-nix"; + stylix.url = "github:danth/stylix"; home-manager = { url = "github:nix-community/home-manager"; @@ -37,6 +38,7 @@ modules = [ ./home-manager/home.nix inputs.sops-nix.homeManagerModules.sops + inputs.stylix.homeManagerModules.stylix ]; }; }; diff --git a/home-manager/modules/alacritty.nix b/home-manager/modules/alacritty.nix index 07e58fb..fee9d21 100644 --- a/home-manager/modules/alacritty.nix +++ b/home-manager/modules/alacritty.nix @@ -1,22 +1,21 @@ -{ +{ lib, ... }: { programs.alacritty = { enable = true; settings = { window = { - opacity = 0.5; + opacity = lib.mkDefault 0.5; blur = true; }; - font = { + font = lib.mkDefault { size = 13.0; - # draw_bold_text_with_bright_colors = true; normal = { family = "JetBrains Mono"; style = "Bold"; }; }; - colors.primary.background = "#1d2021"; + colors.primary.background = lib.mkDefault "#1d2021"; }; }; } diff --git a/home-manager/modules/bundle.nix b/home-manager/modules/bundle.nix index 6b2c20a..185a00e 100644 --- a/home-manager/modules/bundle.nix +++ b/home-manager/modules/bundle.nix @@ -1,11 +1,11 @@ { imports = [ - ./cursor.nix ./git.nix ./htop.nix ./alacritty.nix ./qt.nix ./sops.nix + ./style.nix ./wms/hyprland.nix ./wms/waybar.nix diff --git a/home-manager/modules/cursor.nix b/home-manager/modules/cursor.nix deleted file mode 100644 index 4dc8a56..0000000 --- a/home-manager/modules/cursor.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ pkgs, ... }: { - home = { - pointerCursor = { - package = pkgs.vanilla-dmz; - name = "Vanilla-DMZ"; - size = 24; - gtk.enable = true; - x11 = { - enable = true; - defaultCursor = true; - }; - }; - }; -} diff --git a/home-manager/modules/style.nix b/home-manager/modules/style.nix new file mode 100644 index 0000000..94ba86e --- /dev/null +++ b/home-manager/modules/style.nix @@ -0,0 +1,36 @@ +{ pkgs, config, lib, ... }: { + stylix = { + enable = true; + targets = { + hyprland.enable = false; + waybar.enable = false; + }; + + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + polarity = "dark"; + + image = pkgs.fetchurl { + url = "https://w.wallhaven.cc/full/kx/wallhaven-kxedr7.jpg"; + sha256 = "0ypqnq7bsr2giq7nq1c3xrw2m0gkii9j5zhfp512r93wc96zvm50"; + }; + + fonts = { + monospace = { + name = "JetBrains Mono"; + package = pkgs.jetbrains-mono; + }; + + sizes = { + applications = 13; + desktop = 12; + }; + }; + + opacity = { + popups = .8; + terminal = .5; + }; + }; + + xdg.configFile."helix/config.toml".text = ''theme = "catppuccin_mocha"''; +} diff --git a/home-manager/modules/wms/hyprland.nix b/home-manager/modules/wms/hyprland.nix index 043c737..ef7fb99 100644 --- a/home-manager/modules/wms/hyprland.nix +++ b/home-manager/modules/wms/hyprland.nix @@ -1,6 +1,8 @@ { pkgs, lib, config, ... }: { wayland.windowManager.hyprland = let + colors = config.lib.stylix.colors; + wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { flakeIgnore = [ "E501" "E111" "E701" "E241" "E731" ]; } /*py*/ '' @@ -92,8 +94,8 @@ gaps_in = 5; gaps_out = 20; border_size = 3; - "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; - "col.inactive_border" = "rgba(595959aa)"; + "col.active_border" = "rgba(${colors.base0C}ee) rgba(${colors.base0B}ee) 45deg"; + "col.inactive_border" = "rgba(${colors.base05}aa)"; layout = "dwindle"; }; diff --git a/home-manager/modules/wms/waybar.nix b/home-manager/modules/wms/waybar.nix index f3d9040..9ef1446 100644 --- a/home-manager/modules/wms/waybar.nix +++ b/home-manager/modules/wms/waybar.nix @@ -11,7 +11,10 @@ sha256 = "15j2cqg405q37wrrlm70mhp7rx6xnrn92rfm1ix6g3nl98ksh45g"; }; - programs.waybar = { + programs.waybar = + let + colors = config.lib.stylix.colors; + in { enable = true; settings = { @@ -170,19 +173,18 @@ window#waybar.hidden { margin-right: 8px; border-radius: 10px; transition: none; - background: #383c4a; + background: #${colors.base00}; } #workspaces button { transition: none; - color: #7c818c; + color: #${colors.base04}; background: transparent; padding: 5px; font-size: 18px; } #workspaces button.persistent { - color: #7c818c; font-size: 12px; } @@ -192,13 +194,12 @@ window#waybar.hidden { box-shadow: inherit; text-shadow: inherit; border-radius: inherit; - color: #383c4a; - background: #7c818c; + color: #${colors.base05}; } #workspaces button.active { - background: #4e5263; - color: white; + background: #${colors.base02}; + color: #${colors.base05}; border-radius: inherit; } @@ -206,8 +207,8 @@ window#waybar.hidden { padding: 8px 0px 8px 8px; border-radius: 10px 0px 0px 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #keyboard-state { @@ -215,8 +216,8 @@ window#waybar.hidden { padding: 8px 8px 8px 0px; border-radius: 0px 10px 10px 0px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #custom-pacman { @@ -224,8 +225,8 @@ window#waybar.hidden { padding-right: 8px; border-radius: 10px 0px 0px 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #custom-mail { @@ -233,8 +234,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 0px 10px 10px 0px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #submap { @@ -242,8 +243,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #clock { @@ -252,8 +253,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #network { @@ -262,16 +263,21 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; +} + +#network.disconnected { + color: #${colors.base00}; + background-color: #${colors.base08}; } #custom-weather { padding-right: 16px; border-radius: 0px 10px 10px 0px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #pulseaudio { @@ -280,13 +286,13 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #pulseaudio.muted { - background-color: #90b1b1; - color: #2a5c45; + background-color: #${colors.base08}; + color: #${colors.base01}; } #custom-mem { @@ -295,8 +301,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #cpu { @@ -305,8 +311,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #temperature { @@ -315,12 +321,12 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #temperature.critical { - background-color: #eb4d4b; + background-color: #${colors.base08}; } #backlight { @@ -329,8 +335,8 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #battery { @@ -339,23 +345,23 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #battery.charging { - color: #ffffff; - background-color: #26A65B; + color: #${colors.base05}; + background-color: #${colors.base0B}; } #battery.warning:not(.charging) { - background-color: #ffbe61; + background-color: #${colors.base09}; color: black; } #battery.critical:not(.charging) { - background-color: #f53c3c; - color: #ffffff; + background-color: #${colors.base08}; + color: #${colors.base05}; animation-name: blink; animation-duration: 0.5s; animation-timing-function: linear; @@ -368,22 +374,32 @@ window#waybar.hidden { padding-right: 16px; border-radius: 10px; transition: none; - color: #ffffff; - background: #383c4a; + color: #${colors.base05}; + background: #${colors.base00}; } #mpris{ - background: #383c4a; + background: #${colors.base00}; border-radius: 10px; - color: white; + color: #${colors.base05}; padding: 0px 8px; margin: 0px 8px; } +#mpris.playing { + background-color: #${colors.base0B}; + color: #${colors.base01}; +} + +#mpris.paused { + background-color: #${colors.base0A}; + color: #${colors.base01}; +} + @keyframes blink { to { - background-color: #ffffff; - color: #000000; + background-color: #${colors.base05}; + color: #${colors.base00}; } } '';