141 lines
4.2 KiB
Nix
141 lines
4.2 KiB
Nix
{
|
|
inputs,
|
|
lib,
|
|
pkgs,
|
|
userName,
|
|
...
|
|
}:
|
|
let
|
|
jsonSchemes = pkgs.stdenv.mkDerivation {
|
|
name = "fromYAML";
|
|
phases = "buildPhase";
|
|
buildPhase = ''
|
|
mkdir -p $out/
|
|
#for FILE in ${pkgs.base16-schemes}/share/themes/*; do
|
|
FILE=${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml
|
|
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";
|
|
};
|
|
|
|
emojiFont = {
|
|
package = pkgs.dejavu_fonts;
|
|
name = "DejaVu Sans Mono";
|
|
};
|
|
|
|
makeTheme =
|
|
jsonScheme: polarity:
|
|
let
|
|
palette = json2Palette jsonScheme;
|
|
in
|
|
{
|
|
enable = true;
|
|
base16Scheme.palette = palette;
|
|
inherit polarity;
|
|
fonts = {
|
|
emoji = emojiFont;
|
|
monospace = font;
|
|
sansSerif = font;
|
|
serif = font;
|
|
};
|
|
image =
|
|
let
|
|
wallpaper = inputs.nix-wallpaper.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
|
width = 2560;
|
|
height = 1440;
|
|
backgroundColor = "#${palette.base00}";
|
|
logoColors = {
|
|
color0 = "#${palette.base0D}";
|
|
color1 = "#${palette.base0D}";
|
|
color2 = "#${palette.base0D}";
|
|
color3 = "#${palette.base0D}";
|
|
color4 = "#${palette.base0D}";
|
|
color5 = "#${palette.base0D}";
|
|
};
|
|
};
|
|
|
|
in
|
|
"${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
|
};
|
|
|
|
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");
|
|
#};
|
|
|
|
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
|
|
};
|
|
polarity = "dark";
|
|
in
|
|
{
|
|
enable = true;
|
|
base16Scheme.palette = palette;
|
|
inherit polarity;
|
|
fonts = {
|
|
emoji = emojiFont;
|
|
monospace = font;
|
|
sansSerif = font;
|
|
serif = font;
|
|
};
|
|
image =
|
|
let
|
|
wallpaper = inputs.nix-wallpaper.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
|
|
width = 2560;
|
|
height = 1440;
|
|
backgroundColor = "#${palette.base00}";
|
|
logoColors = {
|
|
color0 = "#${palette.base0D}";
|
|
color1 = "#${palette.base0D}";
|
|
color2 = "#${palette.base0D}";
|
|
color3 = "#${palette.base0D}";
|
|
color4 = "#${palette.base0D}";
|
|
color5 = "#${palette.base0D}";
|
|
};
|
|
};
|
|
|
|
in
|
|
"${wallpaper}/share/wallpapers/nixos-wallpaper.png";
|
|
};
|
|
|
|
#security.sudo.extraConfig = ''
|
|
# ${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/catppuccin-mocha/bin/switch-to-configuration
|
|
# ${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/catppuccin-latte/bin/switch-to-configuration
|
|
# ${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/gruvbox-dark-hard/bin/switch-to-configuration
|
|
# ${userName} ALL = (root) NOPASSWD: /nix/var/nix/profiles/system/specialisation/heetch/bin/switch-to-configuration
|
|
#'';
|
|
}
|