nixos/home/modules/theme.nix

66 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2024-06-07 03:04:16 +00:00
{ pkgs, lib, config, ... }:
let
cfg = config.snowhawk.theme;
2024-06-07 03:04:16 +00:00
in
{
options.snowhawk.theme = {
enable = lib.mkEnableOption "theme";
2024-07-01 19:46:04 +00:00
cursor = lib.mkOption {
default = true;
example = false;
description = "enable home.pointerCursor theme";
type = lib.types.bool;
};
2024-06-07 03:04:16 +00:00
};
config = lib.mkIf cfg.enable {
gtk = {
enable = true;
theme = {
package = pkgs.rose-pine-gtk-theme;
name = "rose-pine";
};
iconTheme = {
package = pkgs.rose-pine-icon-theme;
name = "rose-pine-icons";
};
};
# Set system dark mode
dconf.settings = {
"org/freedesktop/appearance" = {
color-scheme = 1;
};
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
home.pointerCursor = lib.mkIf cfg.cursor
(
let
getFrom = url: hash: name: {
gtk.enable = true;
x11.enable = true;
name = name;
size = 16;
package =
pkgs.runCommand "moveUp" { } ''
mkdir -p $out/share/icons
ln -s ${pkgs.fetchzip {
url = url;
hash = hash;
}} $out/share/icons/${name}
'';
};
in
getFrom
"https://github.com/rose-pine/cursor/releases/download/v1.1.0/BreezeX-RosePine-Linux.tar.xz"
"sha256-t5xwAPGhuQUfGThedLsmtZEEp1Ljjo3Udhd5Ql3O67c="
"BreezeX-RosePine"
);
2024-06-07 03:04:16 +00:00
};
}