From 509fd6e8a6e773d9c682a340913737c676427a87 Mon Sep 17 00:00:00 2001 From: Nathan Braswell Date: Tue, 14 Jan 2025 20:01:38 -0500 Subject: [PATCH] Using the amazing Stylix to set colors automatically based on background and Recursive font everywhere! Also, fuzzel --- flake.lock | 359 ++++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 183 +++++++++++++++------------ 2 files changed, 461 insertions(+), 81 deletions(-) diff --git a/flake.lock b/flake.lock index fbea851..135db3e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,210 @@ { "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1732200724, + "narHash": "sha256-+R1BH5wHhfnycySb7Sy5KbYEaTJZWm1h+LW1OtyhiTs=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "153d52373b0fb2d343592871009a286ec8837aec", + "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-helix": { + "flake": false, + "locked": { + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1731949548, + "narHash": "sha256-XIDexXM66sSh5j/x70e054BnUsviibUShW7XhbDGhYo=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "61165b1632409bd55e530f3dbdd4477f011cadc6", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1734969791, + "narHash": "sha256-A9PxLienMYJ/WUvqFie9qXrNC2MeRRYw7TG/q7DRjZg=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "92f4890bd150fc9d97b61b3583680c0524a8cafe", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "stylix", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "stylix", + "nixpkgs" + ], + "nixpkgs-stable": [ + "stylix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "stylix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1732369855, + "narHash": "sha256-JhUWbcYPjHO3Xs3x9/Z9RuqXbcp5yhPluGjwsdE2GMg=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "dadd58f630eeea41d645ee225a63f719390829dc", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "47.2", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -20,6 +225,27 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1735774425, + "narHash": "sha256-C73gLFnEh8ZI0uDijUgCDWCd21T6I6tsaWgIBHcfAXg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5f6aa268e419d053c3d5025da740e390b12ac936", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "niri": { "inputs": { "niri-stable": "niri-stable", @@ -125,12 +351,143 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1735648875, + "narHash": "sha256-fQ4k/hyQiH9RRPznztsA9kbcDajvwV1sRm01el6Sr3c=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "47e29c20abef74c45322eca25ca1550cdf5c3b50", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "home-manager": "home-manager", "niri": "niri", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "stylix": "stylix" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "git-hooks": "git-hooks", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_2", + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1736882096, + "narHash": "sha256-TQFkQ6RN8L/Xto5Ttt6hwJInFI5Nz2uCfXg5ci2q6UA=", + "owner": "danth", + "repo": "stylix", + "rev": "965d1cb7c84170200b4f05e68ebd27a88d171e8c", + "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" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1729501581, + "narHash": "sha256-1ohEFMC23elnl39kxWnjzH1l2DFWWx4DhFNNYDTYt54=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "f0e7f7974a6441033eb0a172a0342e96722b4f14", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" } }, "xwayland-satellite-stable": { diff --git a/flake.nix b/flake.nix index 6983cf5..7ccf68c 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + stylix.url = "github:danth/stylix"; niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; @@ -14,7 +15,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware/master"; }; - outputs = { self, nixpkgs, niri, home-manager, nixos-hardware }@attrs: + outputs = { self, nixpkgs, stylix, niri, home-manager, nixos-hardware }@attrs: let system = "x86_64-linux"; homeManagerSharedModule = { @@ -40,6 +41,8 @@ Install.WantedBy = [ "default.target" ]; }; + programs.fuzzel.enable = true; + programs.waybar = { # This is to fix backlight if it freaking worked # remove when upgraded from 0.11 @@ -64,54 +67,54 @@ reload_style_on_change = true; }; }; - style = '' - * { - /* - border: none; - border-radius: 0; - */ - font-family: Recursive; - } - window#waybar { - background: transparent; - color: #ffffff; - } - button { - box-shadow: none; - border: none; - border-radius: 0; - transition-property: none; - } - #workspaces button { - padding: 0 5px; - background-color: transparent; - color: #ffffff; - } - #mode { - background-color: #64829D; - border-bottom: 3px solid #ffffff; - } - #memory, #disk, #network, #pulseaudio, #battery, #power-profiles-daemon, #backlight, #clock { - padding: 0 10px; - color: #f0f0ff; - background-color: rgba(30,30,46,0.6); - border-radius: 99px; - margin-left: 4px; - } - #window, #workspaces { - margin: 0 4px; - } - #clock { - font-weight: bold; - } - #battery { - margin-left: 4px; - } - #pulseaudio { - color: #000000; - background-color: #f1c40f; - } - ''; + #style = '' + # * { + # /* + # border: none; + # border-radius: 0; + # */ + # font-family: Recursive; + # } + # window#waybar { + # background: transparent; + # color: #ffffff; + # } + # button { + # box-shadow: none; + # border: none; + # border-radius: 0; + # transition-property: none; + # } + # #workspaces button { + # padding: 0 5px; + # background-color: transparent; + # color: #ffffff; + # } + # #mode { + # background-color: #64829D; + # border-bottom: 3px solid #ffffff; + # } + # #memory, #disk, #network, #pulseaudio, #battery, #power-profiles-daemon, #backlight, #clock { + # padding: 0 10px; + # color: #f0f0ff; + # background-color: rgba(30,30,46,0.6); + # border-radius: 99px; + # margin-left: 4px; + # } + # #window, #workspaces { + # margin: 0 4px; + # } + # #clock { + # font-weight: bold; + # } + # #battery { + # margin-left: 4px; + # } + # #pulseaudio { + # color: #000000; + # background-color: #f1c40f; + # } + #''; }; programs.niri.settings = { @@ -155,34 +158,34 @@ #If you leave the brackets empty, the windows themselves will decide their initial width. #preset-window-heights = {}; default-column-width = { proportion = 1.0 / 2.0; }; - focus-ring = { - enable = false; - width = 8; - # Color of the ring on the active monitor. - active.color = "#7fc8ff"; - # Color of the ring on inactive monitors. - inactive.color = "#505050"; - }; - border = { - enable = true; - width = 4; - active = { - gradient = { - angle = 130; - relative-to = "workspace-view"; - from = "#90F090"; - to = "#909090"; - }; - }; - inactive = { - gradient = { - angle = 130; - relative-to = "workspace-view"; - from = "#409040"; - to = "#404040"; - }; - }; - }; + #focus-ring = { + # enable = false; + # width = 8; + # # Color of the ring on the active monitor. + # active.color = "#7fc8ff"; + # # Color of the ring on inactive monitors. + # inactive.color = "#505050"; + #}; + #border = { + # enable = true; + # width = 4; + # active = { + # gradient = { + # angle = 130; + # relative-to = "workspace-view"; + # from = "#90F090"; + # to = "#909090"; + # }; + # }; + # inactive = { + # gradient = { + # angle = 130; + # relative-to = "workspace-view"; + # from = "#409040"; + # to = "#404040"; + # }; + # }; + #}; #struts = { #left = 64; #right = 64; @@ -191,7 +194,8 @@ #}; }; binds = with config.lib.niri.actions; { - "Alt+P".action = spawn "bemenu-run"; + #"Alt+P".action = spawn "bemenu-run"; + "Alt+P".action = spawn "fuzzel"; "Alt+Return".action = spawn "ghostty"; "Alt+Shift+Return".action = spawn "foot"; "Alt+Shift+Slash".action = show-hotkey-overlay; @@ -320,7 +324,9 @@ #theme = "MonaLisa"; #theme = "Monokai Remastered"; #theme = "Monokai Soda"; - theme = "NightLion v2"; + + #theme = "NightLion v2"; + #theme = "niji"; #theme = "Nocturnal Winter"; #theme = "nord"; @@ -373,7 +379,7 @@ #font = "JetBrainsMono:size=8"; #font = "Iosevka:size=18"; #font = "Monoid:size=6"; - font = "Recursive:size=16"; # seems to be Recursive Mono Linear Static in Ghostty + #font = "Recursive:size=16"; # seems to be Recursive Mono Linear Static in Ghostty #dpi-aware = "yes"; }; mouse = { @@ -593,6 +599,22 @@ services.printing.enable = true; services.printing.drivers = [ pkgs.brlaser ]; + stylix = { + enable = true; + #image = /home/nathan/Wallpapers/walls/green-tea.jpg; + image = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/kiedtl/walls/refs/heads/master/green-tea.jpg"; + sha256 = "sha256-+NcZMBnbEWurmkOkzdrxGwBlxzUO3Sitt6Uoq9plc7o="; + }; + polarity = "dark"; + fonts = { + # hehe casual as serif + serif = { package = pkgs.recursive; name = "Recursive Sans Casual Static"; }; + sansSerif = { package = pkgs.recursive; name = "Recursive Sans Linear Static"; }; + monospace = { package = pkgs.recursive; name = "Recursive Mono Linear Static"; }; + emoji = { package = pkgs.noto-fonts-emoji; name = "Noto Color Emoji"; }; + }; + }; programs.niri = { enable = true; package = pkgs.niri; @@ -691,6 +713,7 @@ specialArgs = attrs; modules = [ nixos-hardware.nixosModules.framework-13-7040-amd + stylix.nixosModules.stylix niri.nixosModules.niri home-manager.nixosModules.home-manager homeManagerSharedModule