feat: switch theme with nix specialisations
This commit is contained in:
@@ -2,15 +2,14 @@
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeModules.nixvim
|
||||
inputs.stylix.homeModules.stylix
|
||||
inputs.zen-browser.homeModules.default
|
||||
#inputs.stylix.homeModules.stylix
|
||||
|
||||
./programs
|
||||
|
||||
./clangd.nix
|
||||
./hyprland.nix
|
||||
./packages.nix
|
||||
./stylix.nix
|
||||
./xdg.nix
|
||||
];
|
||||
|
||||
@@ -18,6 +17,14 @@
|
||||
home.homeDirectory = "/home/autumn";
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
stylix = {
|
||||
targets.waybar.enable = false;
|
||||
targets.zathura.enable = false;
|
||||
targets.vesktop.enable = false;
|
||||
targets.zen-browser.profileNames = [ "default" ];
|
||||
targets.gnome.enable = false;
|
||||
};
|
||||
|
||||
nixpkgs.config = {
|
||||
allowUnfree = true;
|
||||
allowUnfreePredicate = _: true;
|
||||
|
||||
+50
-54
@@ -1,46 +1,48 @@
|
||||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
stylix =
|
||||
let
|
||||
palette = {
|
||||
base00 = "11111a"; # #11111a
|
||||
base01 = "181825"; # #181825
|
||||
base02 = "313244"; # #313244
|
||||
base03 = "45475a"; # #45475a
|
||||
base04 = "585b70"; # #585b70
|
||||
base05 = "cdd6f4"; # #cdd6f4
|
||||
base06 = "f5e0dc"; # #f5e0dc
|
||||
base07 = "b4befe"; # #b4befe
|
||||
base08 = "f38ba8"; # #f38ba8
|
||||
base09 = "fab387"; # #fab387
|
||||
base0A = "f9e2af"; # #f9e2af
|
||||
base0B = "a6e3a1"; # #a6e3a1
|
||||
base0C = "94e2d5"; # #94e2d5
|
||||
base0D = "f5c2e7"; # #f5c2e7
|
||||
base0E = "cba6f7"; # #cba6f7
|
||||
base0F = "f2cdcd"; # #f2cdcd
|
||||
|
||||
#base00 = "1d2021"; # #1d2021
|
||||
#base01 = "3c3836"; # #3c3836
|
||||
#base02 = "504945"; # #504945
|
||||
#base03 = "665c54"; # #665c54
|
||||
#base04 = "bdae93"; # #bdae93
|
||||
#base05 = "d5c4a1"; # #d5c4a1
|
||||
#base06 = "ebdbb2"; # #ebdbb2
|
||||
#base07 = "fbf1c7"; # #fbf1c7
|
||||
#base08 = "fb4934"; # #fb4934
|
||||
#base09 = "fe8019"; # #fe8019
|
||||
#base0A = "fabd2f"; # #fabd2f
|
||||
#base0B = "b8bb26"; # #b8bb26
|
||||
#base0C = "8ec07c"; # #8ec07c
|
||||
#base0D = "83a598"; # #83a598
|
||||
#base0E = "d3869b"; # #d3869b
|
||||
#base0F = "d65d0e"; # #d65d0e
|
||||
let
|
||||
jsonSchemes = pkgs.stdenv.mkDerivation {
|
||||
name = "fromYAML";
|
||||
phases = "buildPhase";
|
||||
buildPhase = ''
|
||||
mkdir -p $out/
|
||||
for FILE in ${pkgs.base16-schemes}/share/themes/*; do
|
||||
FILEBASENAME="$(basename $FILE .yaml).json"
|
||||
cat $FILE | ${pkgs.yaml2json}/bin/yaml2json | sed s/#//g > $out/$FILEBASENAME
|
||||
done
|
||||
ls -l $out/
|
||||
'';
|
||||
};
|
||||
|
||||
json2Palette =
|
||||
jsonScheme: (builtins.fromJSON (builtins.readFile "${jsonSchemes}/${jsonScheme}.json")).palette;
|
||||
|
||||
font = {
|
||||
package = pkgs.nerd-fonts.caskaydia-cove;
|
||||
name = "CaskaydiaCove Nerd Font";
|
||||
};
|
||||
|
||||
makeTheme =
|
||||
jsonScheme: polarity:
|
||||
let
|
||||
palette = json2Palette jsonScheme;
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
base16Scheme.palette = palette;
|
||||
inherit polarity;
|
||||
fonts = {
|
||||
emoji = font;
|
||||
monospace = font;
|
||||
sansSerif = font;
|
||||
serif = font;
|
||||
};
|
||||
image =
|
||||
let
|
||||
wallpaper = inputs.nix-wallpaper.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
||||
width = 2560;
|
||||
height = 1440;
|
||||
@@ -54,25 +56,19 @@
|
||||
color5 = "#${palette.base0D}";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
{
|
||||
enable = true;
|
||||
image = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
||||
polarity = "dark";
|
||||
fonts =
|
||||
let
|
||||
font = {
|
||||
package = pkgs.nerd-fonts.caskaydia-cove;
|
||||
name = "CaskaydiaCove Nerd Font";
|
||||
};
|
||||
in
|
||||
{
|
||||
monospace = font;
|
||||
serif = font;
|
||||
sansSerif = font;
|
||||
emoji = font;
|
||||
"${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
||||
};
|
||||
base16Scheme.palette = palette;
|
||||
|
||||
in
|
||||
{
|
||||
stylix = makeTheme "catppuccin-mocha" "dark";
|
||||
|
||||
specialisation = {
|
||||
catppuccin-mocha.configuration.stylix = lib.mkForce (makeTheme "catppuccin-mocha" "dark");
|
||||
catppuccin-latte.configuration.stylix = lib.mkForce (makeTheme "catppuccin-latte" "light");
|
||||
gruvbox-dark-hard.configuration.stylix = lib.mkForce (makeTheme "gruvbox-dark-hard" "dark");
|
||||
heetch.configuration.stylix = lib.mkForce (makeTheme "heetch" "dark");
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user