feat: switch theme with nix specialisations
This commit is contained in:
@@ -2,15 +2,14 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixvim.homeModules.nixvim
|
inputs.nixvim.homeModules.nixvim
|
||||||
inputs.stylix.homeModules.stylix
|
|
||||||
inputs.zen-browser.homeModules.default
|
inputs.zen-browser.homeModules.default
|
||||||
|
#inputs.stylix.homeModules.stylix
|
||||||
|
|
||||||
./programs
|
./programs
|
||||||
|
|
||||||
./clangd.nix
|
./clangd.nix
|
||||||
./hyprland.nix
|
./hyprland.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
./stylix.nix
|
|
||||||
./xdg.nix
|
./xdg.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -18,6 +17,14 @@
|
|||||||
home.homeDirectory = "/home/autumn";
|
home.homeDirectory = "/home/autumn";
|
||||||
home.stateVersion = "25.05";
|
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 = {
|
nixpkgs.config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
allowUnfreePredicate = _: true;
|
allowUnfreePredicate = _: true;
|
||||||
|
|||||||
+48
-52
@@ -1,46 +1,48 @@
|
|||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
|
||||||
stylix =
|
|
||||||
let
|
let
|
||||||
palette = {
|
jsonSchemes = pkgs.stdenv.mkDerivation {
|
||||||
base00 = "11111a"; # #11111a
|
name = "fromYAML";
|
||||||
base01 = "181825"; # #181825
|
phases = "buildPhase";
|
||||||
base02 = "313244"; # #313244
|
buildPhase = ''
|
||||||
base03 = "45475a"; # #45475a
|
mkdir -p $out/
|
||||||
base04 = "585b70"; # #585b70
|
for FILE in ${pkgs.base16-schemes}/share/themes/*; do
|
||||||
base05 = "cdd6f4"; # #cdd6f4
|
FILEBASENAME="$(basename $FILE .yaml).json"
|
||||||
base06 = "f5e0dc"; # #f5e0dc
|
cat $FILE | ${pkgs.yaml2json}/bin/yaml2json | sed s/#//g > $out/$FILEBASENAME
|
||||||
base07 = "b4befe"; # #b4befe
|
done
|
||||||
base08 = "f38ba8"; # #f38ba8
|
ls -l $out/
|
||||||
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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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 {
|
wallpaper = inputs.nix-wallpaper.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
||||||
width = 2560;
|
width = 2560;
|
||||||
height = 1440;
|
height = 1440;
|
||||||
@@ -54,25 +56,19 @@
|
|||||||
color5 = "#${palette.base0D}";
|
color5 = "#${palette.base0D}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
|
||||||
|
|
||||||
{
|
in
|
||||||
enable = true;
|
"${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
||||||
image = "${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
|
||||||
polarity = "dark";
|
|
||||||
fonts =
|
|
||||||
let
|
|
||||||
font = {
|
|
||||||
package = pkgs.nerd-fonts.caskaydia-cove;
|
|
||||||
name = "CaskaydiaCove Nerd Font";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
monospace = font;
|
stylix = makeTheme "catppuccin-mocha" "dark";
|
||||||
serif = font;
|
|
||||||
sansSerif = font;
|
specialisation = {
|
||||||
emoji = font;
|
catppuccin-mocha.configuration.stylix = lib.mkForce (makeTheme "catppuccin-mocha" "dark");
|
||||||
};
|
catppuccin-latte.configuration.stylix = lib.mkForce (makeTheme "catppuccin-latte" "light");
|
||||||
base16Scheme.palette = palette;
|
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