diff --git a/flake.lock b/flake.lock index ee7b8a7..8e8e8eb 100644 --- a/flake.lock +++ b/flake.lock @@ -71,11 +71,11 @@ "base16-helix": { "flake": false, "locked": { - "lastModified": 1760703920, - "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", + "lastModified": 1776754714, + "narHash": "sha256-E3OAK27smtATTmX45uoTSRsVD+Y+ZiVVfgM/tjpbtYg=", "owner": "tinted-theming", "repo": "base16-helix", - "rev": "d646af9b7d14bff08824538164af99d0c521b185", + "rev": "4d508123037e7851ad36ebf7d9c48b0e9e1eb581", "type": "github" }, "original": { @@ -107,11 +107,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1777069669, - "narHash": "sha256-cEyV6jpC7pX/TNoHI+VDiTDjQc0rfYAkDLRJP2hZrzc=", + "lastModified": 1777744353, + "narHash": "sha256-8UmzMm5wkq+z0kEMEjowoECa4qY813z747o0g+G/bbE=", "owner": "9001", "repo": "copyparty", - "rev": "6e25d648a900f65a4546a1b17a9761c0f1e9e3cb", + "rev": "da6e2ddca96dffc4dbe53bda25d2034428fad3d0", "type": "github" }, "original": { @@ -127,11 +127,11 @@ ] }, "locked": { - "lastModified": 1776613567, - "narHash": "sha256-gC9Cp5ibBmGD5awCA9z7xy6MW6iJufhazTYJOiGlCUI=", + "lastModified": 1777713215, + "narHash": "sha256-8GzXDOXckDWwST8TY5DbwYFjdvQLlP7K9CLSVx6iTTo=", "owner": "nix-community", "repo": "disko", - "rev": "32f4236bfc141ae930b5ba2fb604f561fed5219d", + "rev": "63b4e7e6cf75307c1d26ac3762b886b5b0247267", "type": "github" }, "original": { @@ -146,11 +146,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1777344615, - "narHash": "sha256-pg93DT6h9qGnchIAcJp6Tpt45sJ+8CZXmro2+Xhi/Gc=", + "lastModified": 1777975488, + "narHash": "sha256-JyrUp9HJCMyPj+rcrlMO2TpsKdM5Dhj7KnIg4W1CuKs=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "b1f0d6617ca484adaf0c3ea410f9681f1532b460", + "rev": "695015ae8c42435944f62d25e6b5546948ea3e1e", "type": "github" }, "original": { @@ -163,11 +163,11 @@ "firefox-gnome-theme": { "flake": false, "locked": { - "lastModified": 1775176642, - "narHash": "sha256-2veEED0Fg7Fsh81tvVDNYR6SzjqQxa7hbi18Jv4LWpM=", + "lastModified": 1776136500, + "narHash": "sha256-r0gN2brVWA351zwMV0Flmlcd6SGMvYqFbvC3DfKFM8Y=", "owner": "rafaelmardojai", "repo": "firefox-gnome-theme", - "rev": "179704030c5286c729b5b0522037d1d51341022c", + "rev": "0f8ba203d475587f477e7ae12661bd8459e225b7", "type": "github" }, "original": { @@ -436,11 +436,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1777330550, - "narHash": "sha256-jRRC7Ck+DzH98uWaD9i+ManOquec2qSRcBfyxWvenuA=", + "lastModified": 1777910456, + "narHash": "sha256-YXQ5bhn5mklMsOuVqze3QBqqL+8zsUum24Yx1K2Rb+w=", "ref": "refs/heads/main", - "rev": "e1bda229bdf070f1eed01858f862ca975783df71", - "revCount": 7196, + "rev": "eff3bfe261e90b8950b59379ca7815f735a7aab6", + "revCount": 7252, "type": "git", "url": "https://github.com/hyprwm/Hyprland" }, @@ -512,11 +512,11 @@ ] }, "locked": { - "lastModified": 1777292613, - "narHash": "sha256-sF3JQ9WY33Gam/WNoveIwVGgvREZNfxRONf4jD5hC3A=", + "lastModified": 1777937752, + "narHash": "sha256-QDc78DC6xhWKpPJzsPEJBBFYpTb+g4kO6+ydRYLU4f4=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "6c0d26b2676f71f4c382d34c5a59491b0aafd03d", + "rev": "b6e080577daf6575b95e6733dd2e2aef714bcf10", "type": "github" }, "original": { @@ -643,11 +643,11 @@ ] }, "locked": { - "lastModified": 1777148223, - "narHash": "sha256-PTf7kRFFzCW6rIYxLH2fWfVJmj86FSYe3k6L8B+IM9o=", + "lastModified": 1777492286, + "narHash": "sha256-PwuoEJQcjSKJNP5T55qhfDwIP0tw5zxEhfu8GDfKfeg=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "fa3992be2dfebe4ab06d753c6ca59bea298e798f", + "rev": "ec5c0c709706bad5b82f667fd8758eae442577ce", "type": "github" }, "original": { @@ -750,11 +750,11 @@ ] }, "locked": { - "lastModified": 1777282995, - "narHash": "sha256-DeVNOjfSIfwSe4KMcc/QZst68QwhEm6jd/rQYdRZHCQ=", + "lastModified": 1777888924, + "narHash": "sha256-CZ9akWHCqoWlyi+alSalkzaA0hq1Cs1Tv7MnM/zMVLQ=", "owner": "Mic92", "repo": "nix-ld", - "rev": "7b7c075009dff1c3fd5fdcf63dd5d22fdbde34d6", + "rev": "4161b94cb918d228f0452927950ed295c0131a48", "type": "github" }, "original": { @@ -801,11 +801,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1776983936, - "narHash": "sha256-ZOQyNqSvJ8UdrrqU1p7vaFcdL53idK+LOM8oRWEWh6o=", + "lastModified": 1777917524, + "narHash": "sha256-k+LVe9YaO2BEPB9AaCtTtOMCeGi4dxDo6gt4Un3qoPY=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "2096f3f411ce46e88a79ae4eafcfc9df8ed41c61", + "rev": "df7783100babf59001340a7a874ba3824e441ecb", "type": "github" }, "original": { @@ -832,11 +832,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1777077449, - "narHash": "sha256-AIiMJiqvGrN4HyLEbKAoCSRRYn0rnlW5VbKNIMIYqm4=", + "lastModified": 1777673416, + "narHash": "sha256-5c2POKPOjU40Kh0MirOdScBLG0bu9TAuPYAtPRNZMBs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a4bf06618f0b5ee50f14ed8f0da77d34ecc19160", + "rev": "26ef669cffa904b6f6832ab57b77892a37c1a671", "type": "github" }, "original": { @@ -848,11 +848,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1776877367, - "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=", + "lastModified": 1777578337, + "narHash": "sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM+Z4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0726a0ecb6d4e08f6adced58726b95db924cef57", + "rev": "15f4ee454b1dce334612fa6843b3e05cf546efab", "type": "github" }, "original": { @@ -968,11 +968,11 @@ ] }, "locked": { - "lastModified": 1775228139, - "narHash": "sha256-ebbeHmg+V7w8050bwQOuhmQHoLOEOfqKzM1KgCTexK4=", + "lastModified": 1777598946, + "narHash": "sha256-X239dAGaU1+gfDj8jKH8GzlqKMcxaVfXOio+uzBOkeE=", "owner": "nix-community", "repo": "NUR", - "rev": "601971b9c89e0304561977f2c28fa25e73aa7132", + "rev": "5d55af01c0f86be583931fe99207fc56c14134b3", "type": "github" }, "original": { @@ -1084,11 +1084,11 @@ ] }, "locked": { - "lastModified": 1777338324, - "narHash": "sha256-bc+ZZCmOTNq86/svGnw0tVpH7vJaLYvGLLKFYP08Q8E=", + "lastModified": 1777944972, + "narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=", "owner": "Mic92", "repo": "sops-nix", - "rev": "8eaee5c45428b28b8c47a83e4c09dccec5f279b5", + "rev": "c591bf665727040c6cc5cb409079acb22dcce33c", "type": "github" }, "original": { @@ -1105,11 +1105,11 @@ "nix-filter": "nix-filter" }, "locked": { - "lastModified": 1777235927, - "narHash": "sha256-ql1ouZMN4xULMIHQJRNHNMHI2Cw8K0pugR6pXU3cKCs=", + "lastModified": 1777409658, + "narHash": "sha256-fBUjkrBbODd6c6j9sRfWvxqJrBHMHvp8WjAASfAqin4=", "owner": "Duckonaut", "repo": "split-monitor-workspaces", - "rev": "2dcc901799b5ebc8558584bcc993971dd64351ed", + "rev": "206fc9ed4e35bdaea60c4ae16927376ff3ebac9d", "type": "github" }, "original": { @@ -1138,11 +1138,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1776893932, - "narHash": "sha256-AFD5cf9eNqXq1brHS63xeZy2xKZMgG9J86XJ9I2eLn8=", + "lastModified": 1777835090, + "narHash": "sha256-VLH8zPweblCOvpnQXp4fVs7f6Q79YhXF5XFKlOrvIFk=", "owner": "nix-community", "repo": "stylix", - "rev": "84971726c7ef0bb3669a5443e151cc226e65c518", + "rev": "7989a1054b01153212dede6005abfd1576b8328c", "type": "github" }, "original": { @@ -1252,11 +1252,11 @@ "tinted-schemes": { "flake": false, "locked": { - "lastModified": 1772661346, - "narHash": "sha256-4eu3LqB9tPqe0Vaqxd4wkZiBbthLbpb7llcoE/p5HT0=", + "lastModified": 1777041405, + "narHash": "sha256-BAGZ7ObFV/9Z61OJZun7ifPyhkuHqNuW1QIhQ8LuzCo=", "owner": "tinted-theming", "repo": "schemes", - "rev": "13b5b0c299982bb361039601e2d72587d6846294", + "rev": "5f868b3a338b6904c47f3833b9c411be641983a8", "type": "github" }, "original": { @@ -1268,11 +1268,11 @@ "tinted-tmux": { "flake": false, "locked": { - "lastModified": 1772934010, - "narHash": "sha256-x+6+4UvaG+RBRQ6UaX+o6DjEg28u4eqhVRM9kpgJGjQ=", + "lastModified": 1777169200, + "narHash": "sha256-h7dDbIzP5hDr9v97w9PL6jdAgXawmj6krcH+959rqpU=", "owner": "tinted-theming", "repo": "tinted-tmux", - "rev": "c3529673a5ab6e1b6830f618c45d9ce1bcdd829d", + "rev": "f798c2dce44ef815bb6b8f05a82135c7942d35ac", "type": "github" }, "original": { @@ -1284,11 +1284,11 @@ "tinted-zed": { "flake": false, "locked": { - "lastModified": 1772909925, - "narHash": "sha256-jx/5+pgYR0noHa3hk2esin18VMbnPSvWPL5bBjfTIAU=", + "lastModified": 1777463218, + "narHash": "sha256-Bhkozqtq3BKLqWTlmKm8uAptfX4aRGI8QX3eEL54Vpc=", "owner": "tinted-theming", "repo": "base16-zed", - "rev": "b4d3a1b3bcbd090937ef609a0a3b37237af974df", + "rev": "5768d08ed2e7944a26a958868cdb073cb8856dae", "type": "github" }, "original": { @@ -1299,11 +1299,11 @@ }, "unstable": { "locked": { - "lastModified": 1776877367, - "narHash": "sha256-EHq1/OX139R1RvBzOJ0aMRT3xnWyqtHBRUBuO1gFzjI=", + "lastModified": 1777954456, + "narHash": "sha256-hGdgeU2Nk87RAuZyYjyDjFL6LK7dAZN5RE9+hrDTkDU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0726a0ecb6d4e08f6adced58726b95db924cef57", + "rev": "549bd84d6279f9852cae6225e372cc67fb91a4c1", "type": "github" }, "original": { @@ -1320,11 +1320,11 @@ ] }, "locked": { - "lastModified": 1777349711, - "narHash": "sha256-PGKgo2dO6fK603QGI+DWXdKmS09pbJjjTxwRHdhkGZA=", + "lastModified": 1777988791, + "narHash": "sha256-DtbtSW5+Hls7z+D9BfsAXvFuivt5iZ0OzUXjQ8d8lB8=", "owner": "nix-community", "repo": "home-manager", - "rev": "c1140540536d483e2730320100f6835d62c94fdf", + "rev": "d987617879f613053f6fdf4491fe28ce0283d543", "type": "github" }, "original": { @@ -1425,11 +1425,11 @@ "nixpkgs": "nixpkgs_8" }, "locked": { - "lastModified": 1777356688, - "narHash": "sha256-fOhJpz7QAkBWAAih72CmnIfIN0pHfuZjhZQ/hBLNWxo=", + "lastModified": 1777959875, + "narHash": "sha256-kL2gxkGbIawygfc+DJhWBXAcRplFQlLyDBb4JHCxTzw=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "b3c972b3d8537a9cf7a0db96b164c9c3e580884a", + "rev": "604c3c8814c87eac54d804253ab520cb8fac7b21", "type": "github" }, "original": { diff --git a/hm-modules/default.nix b/hm-modules/default.nix index ffcc8c8..6bed9cb 100644 --- a/hm-modules/default.nix +++ b/hm-modules/default.nix @@ -10,5 +10,6 @@ ./terminal ./development ./notification + ./theme ]; } diff --git a/hm-modules/random/kanshi/default.nix b/hm-modules/random/kanshi/default.nix index 80338e8..a54e55c 100644 --- a/hm-modules/random/kanshi/default.nix +++ b/hm-modules/random/kanshi/default.nix @@ -46,7 +46,7 @@ in { criteria = "Lenovo Group Limited LEN G34w-10 URW07XK8"; position = "2560,0"; - mode = "3440x1440@50Hz"; + mode = "3440x1440@60Hz"; } ]; }; @@ -76,9 +76,9 @@ in position = "480,1440"; } { - criteria = "DP-5"; + criteria = "Lenovo Group Limited LEN G34w-10 URW07XK8"; position = "0,0"; - mode = "3440x1440@50Hz"; + mode = "3440x1440@60Hz"; } ]; }; diff --git a/hm-modules/theme/default.nix b/hm-modules/theme/default.nix new file mode 100644 index 0000000..e3c8ea0 --- /dev/null +++ b/hm-modules/theme/default.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.dov.dynamic-theme; + schemes = "${pkgs.base16-schemes}/share/themes"; + + # Single source of truth for builtin themes + builtinThemes = { + gruvbox = { + dark = "${schemes}/gruvbox-dark-hard.yaml"; + light = "${schemes}/gruvbox-light-hard.yaml"; + }; + catppuccin = { + dark = "${schemes}/catppuccin-mocha.yaml"; + light = "${schemes}/catppuccin-latte.yaml"; + }; + }; + +in { + options.dov.dynamic-theme = { + enable = mkEnableOption "dynamic theme switching"; + + themes = mkOption { + type = types.attrsOf (types.submodule { + options = { + dark = mkOption { + type = types.path; + description = "Path to dark variant base16 scheme"; + }; + light = mkOption { + type = types.path; + description = "Path to light variant base16 scheme"; + }; + }; + }); + default = builtinThemes; + description = "Available themes with dark and light variants"; + }; + }; + + config = mkIf cfg.enable { + # HM-level stylix config inherits from NixOS level + # Specialisations are handled by NixOS module + stylix = { + enable = true; + autoEnable = true; + }; + }; +} diff --git a/machines/fujin/hardware-configuration.nix b/machines/fujin/hardware-configuration.nix index d36aa51..b5a22e7 100644 --- a/machines/fujin/hardware-configuration.nix +++ b/machines/fujin/hardware-configuration.nix @@ -26,7 +26,7 @@ kernelModules = [ ]; }; kernelModules = [ "kvm-amd" ]; - kernelPackages = pkgs.linuxPackages_latest; + kernelPackages = pkgs.linuxPackages_6_18; # allow perf as user | needed for intellij to run profiler kernel.sysctl."kernel.perf_event_paranoid" = 1; diff --git a/machines/fujin/main/default.nix b/machines/fujin/main/default.nix index 4b9ef4b..cf8b01f 100644 --- a/machines/fujin/main/default.nix +++ b/machines/fujin/main/default.nix @@ -110,6 +110,8 @@ display-manager.ly.enable = true; gaming.enable = true; + + dynamic-theme.enable = true; }; ### @@ -126,7 +128,7 @@ stylix = { enable = true; - base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; + # base16Scheme managed by dov.dynamic-theme module fonts = { serif = { diff --git a/machines/fujin/main/dotfiles/.config/doom/config.el b/machines/fujin/main/dotfiles/.config/doom/config.el index 3df8d4f..835da19 100644 --- a/machines/fujin/main/dotfiles/.config/doom/config.el +++ b/machines/fujin/main/dotfiles/.config/doom/config.el @@ -367,6 +367,31 @@ Must be called BEFORE jdtls starts. Sets global lsp-java-vmargs." ;; Enable LSP for nix-mode (add-hook! 'nix-mode-hook #'lsp-deferred) +;; Protobuf configuration +(use-package! protobuf-mode + :mode "\\.proto\\'" + :hook (protobuf-mode . lsp-deferred) + :config + ;; Custom indentation (2 spaces, no tabs) + (defconst my-protobuf-style + '((c-basic-offset . 2) + (indent-tabs-mode . nil))) + (add-hook 'protobuf-mode-hook + (lambda () (c-add-style "my-protobuf-style" my-protobuf-style t)))) + +;; Register buf LSP client for protobuf +(after! lsp-mode + (lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection '("buf" "lsp" "serve")) + :activation-fn (lsp-activate-on "protobuf") + :language-id "protobuf" + :priority 1 + :server-id 'buf-lsp))) + (after! treemacs - (setq treemacs-collapse-dirs 3) - ) + (setq treemacs-collapse-dirs 3)) + +;; Prevent evil-jumps-history from corrupting savehist +;; (it contains markers/buffers that can't serialize properly) +(after! savehist + (add-to-list 'savehist-ignored-variables 'evil-jumps-history)) diff --git a/machines/fujin/main/dotfiles/.config/doom/packages.el b/machines/fujin/main/dotfiles/.config/doom/packages.el index 73ba953..041d47f 100644 --- a/machines/fujin/main/dotfiles/.config/doom/packages.el +++ b/machines/fujin/main/dotfiles/.config/doom/packages.el @@ -56,3 +56,5 @@ (package! web-server) (package! just-mode) + +(package! protobuf-mode) diff --git a/machines/fujin/main/home.nix b/machines/fujin/main/home.nix index 9e48892..89f876d 100644 --- a/machines/fujin/main/home.nix +++ b/machines/fujin/main/home.nix @@ -68,6 +68,8 @@ }; notification.mako.enable = true; + + dynamic-theme.enable = true; }; programs = { diff --git a/modules/default.nix b/modules/default.nix index 39e19c4..7025821 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -15,5 +15,6 @@ ./gitlab ./jenkins ./gaming + ./theme ]; } diff --git a/modules/development/emacs/default.nix b/modules/development/emacs/default.nix index 2e33218..284d076 100644 --- a/modules/development/emacs/default.nix +++ b/modules/development/emacs/default.nix @@ -56,7 +56,7 @@ in { shellcheck # :lang typescript #javascript-typescript-langserver # deprecated - deno + #deno # :lang go # go # gopls diff --git a/modules/theme/default.nix b/modules/theme/default.nix new file mode 100644 index 0000000..481c934 --- /dev/null +++ b/modules/theme/default.nix @@ -0,0 +1,65 @@ +{ config, lib, pkgs, username, ... }: + +with lib; + +let + # Access HM theme config + hmCfg = config.home-manager.users.${username}.dov.dynamic-theme; + + allThemes = hmCfg.themes; + + # Generate all theme-variant combinations + themeVariants = concatMapAttrs (name: theme: { + "${name}-dark" = { scheme = theme.dark; polarity = "dark"; }; + "${name}-light" = { scheme = theme.light; polarity = "light"; }; + }) allThemes; + + # Base is gruvbox-dark, everything else is a specialisation + baseVariant = "gruvbox-dark"; + specialisationVariants = filterAttrs (name: _: name != baseVariant) themeVariants; + + availableVariants = concatStringsSep " " (attrNames themeVariants); + + theme-switch = pkgs.writeShellScriptBin "theme-switch" '' + case "$1" in + ${baseVariant}) + echo "Switching to ${baseVariant}..." + sudo nixos-rebuild switch --flake ~/nixos#${username} + ;; + ${concatStringsSep "\n " (map (name: '' + ${name}) + echo "Switching to ${name}..." + sudo nixos-rebuild switch --flake ~/nixos#${username} --specialisation ${name} + ;;'') (attrNames specialisationVariants))} + *) + echo "Usage: theme-switch " + echo "Available: ${availableVariants}" + exit 1 + ;; + esac + ''; + +in { + options.dov.dynamic-theme.enable = mkEnableOption "NixOS dynamic theme specialisations"; + + config = mkIf (config.dov.dynamic-theme.enable && hmCfg.enable) { + # Add theme-switch script system-wide + environment.systemPackages = [ theme-switch ]; + + # Base theme: gruvbox-dark + stylix = { + base16Scheme = mkDefault themeVariants.${baseVariant}.scheme; + polarity = mkDefault themeVariants.${baseVariant}.polarity; + }; + + # Generate NixOS specialisations for all other variants + specialisation = mapAttrs (name: variant: { + configuration = { + stylix = { + base16Scheme = mkForce variant.scheme; + polarity = mkForce variant.polarity; + }; + }; + }) specialisationVariants; + }; +}