nixos-config/user/style/stylix.nix

106 lines
3.2 KiB
Nix
Raw Normal View History

2023-08-15 05:33:43 +05:30
{ config, lib, pkgs, theme, font, fontPkg, wmType, ... }:
2023-05-14 01:06:06 +05:30
let
themePath = "../../../themes"+("/"+theme+"/"+theme)+".yaml";
themePolarity = lib.removeSuffix "\n" (builtins.readFile (./. + "../../../themes"+("/"+theme)+"/polarity.txt"));
backgroundUrl = builtins.readFile (./. + "../../../themes"+("/"+theme)+"/backgroundurl.txt");
backgroundSha256 = builtins.readFile (./. + "../../../themes/"+("/"+theme)+"/backgroundsha256.txt");
2023-05-14 01:06:06 +05:30
in
{
home.file.".currenttheme".text = theme;
stylix.autoEnable = false;
stylix.polarity = themePolarity;
stylix.image = pkgs.fetchurl {
url = backgroundUrl;
sha256 = backgroundSha256;
};
stylix.base16Scheme = ./. + themePath;
2023-05-14 01:06:06 +05:30
stylix.fonts = {
monospace = {
name = font;
package = fontPkg;
2023-05-14 01:06:06 +05:30
};
serif = {
name = font;
package = fontPkg;
2023-05-14 01:06:06 +05:30
};
sansSerif = {
name = font;
package = fontPkg;
2023-05-14 01:06:06 +05:30
};
emoji = {
name = "Noto Color Emoji";
package = pkgs.noto-fonts-emoji-blob-bin;
};
sizes = {
terminal = 18;
2023-08-15 05:33:43 +05:30
applications = 12;
2023-05-14 01:06:06 +05:30
popups = 12;
desktop = 12;
};
};
stylix.targets.alacritty.enable = true;
stylix.targets.kitty.enable = true;
stylix.targets.gtk.enable = true;
2023-08-15 05:33:43 +05:30
stylix.targets.rofi.enable = if (wmType == "x11") then true else false;
stylix.targets.feh.enable = if (wmType == "x11") then true else false;
programs.feh.enable = true;
home.file.".fehbg-stylix".text = ''
#!/bin/sh
2023-08-14 07:27:28 +05:30
feh --no-fehbg --bg-fill ''+config.stylix.image+'';
'';
home.file.".fehbg-stylix".executable = true;
2023-08-14 07:27:28 +05:30
home.file.".swaybg-stylix".text = ''
#!/bin/sh
swaybg -m fill -i ''+config.stylix.image+'';
'';
home.file.".swaybg-stylix".executable = true;
# TODO add stylix colors to swaylock cmd
home.file.".swayidle-stylix".text = ''
#!/bin/sh
swaylock_cmd='swaylock --indicator-radius 200 --grace 5 --fade-in 0.5 --screenshots --effect-blur 10x10'
swayidle -w timeout 300 "$swaylock_cmd" \
timeout 600 'hyprctl dispatch dpms off' \
resume 'hyprctl dispatch dpms on' \
before-sleep "$swaylock_cmd"
'';
home.file.".swayidle-stylix".executable = true;
2023-06-09 02:14:40 +05:30
home.file = {
".config/qt5ct/colors/oomox-current.conf".source = config.lib.stylix.colors {
template = builtins.readFile ./oomox-current.conf.mustache;
extension = ".conf";
};
".config/Trolltech.conf".source = config.lib.stylix.colors {
template = builtins.readFile ./Trolltech.conf.mustache;
extension = ".conf";
};
".config/kdeglobals".source = config.lib.stylix.colors {
template = builtins.readFile ./Trolltech.conf.mustache;
extension = "";
};
".config/qt5ct/qt5ct.conf".text = pkgs.lib.mkBefore (builtins.readFile ./qt5ct.conf);
};
2023-08-14 07:27:28 +05:30
home.file.".config/hypr/hyprpaper.conf".text = ''
preload = ''+config.stylix.image+''
wallpaper = eDP-1,''+config.stylix.image+''
wallpaper = HDMI-A-1,''+config.stylix.image+''
wallpaper = DP-1,''+config.stylix.image+''
'';
2023-06-09 02:14:40 +05:30
home.packages = with pkgs; [
qt5ct pkgs.libsForQt5.breeze-qt5
];
home.sessionVariables = {
QT_QPA_PLATFORMTHEME="qt5ct";
};
qt = {
enable = true;
style.package = pkgs.libsForQt5.breeze-qt5;
style.name = "breeze-dark";
};
}