parent
1ce40f2c1a
commit
6ca0d7248b
329 changed files with 178 additions and 139 deletions
modules/desktop/theme
39
modules/desktop/theme/cursors.nix
Normal file
39
modules/desktop/theme/cursors.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
self: {pkgs, ...}: {
|
||||
config = let
|
||||
inherit (self.scopedPackages.${pkgs.system}) dracula;
|
||||
|
||||
cursorTheme = dracula.hyprcursor;
|
||||
cursorThemeName = "Dracula-cursors";
|
||||
hyprcursorThemeName = "Dracula-hyprcursor";
|
||||
cursorSize = 24;
|
||||
in {
|
||||
home.pointerCursor = {
|
||||
name = cursorThemeName;
|
||||
package = dracula.gtk;
|
||||
size = cursorSize;
|
||||
|
||||
gtk.enable = true;
|
||||
|
||||
x11 = {
|
||||
enable = true;
|
||||
defaultCursor = cursorThemeName;
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".local/share/icons/${hyprcursorThemeName}".source = cursorTheme;
|
||||
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
envd = [
|
||||
"XCURSOR_THEME, ${cursorThemeName}"
|
||||
"XCURSOR_SIZE, ${toString cursorSize}"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"hyprctl setcursor ${hyprcursorThemeName} ${toString cursorSize}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./cursors.nix;
|
||||
}
|
29
modules/desktop/theme/default.nix
Normal file
29
modules/desktop/theme/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
self: {...}: {
|
||||
imports = [
|
||||
./gtk
|
||||
./xresources.nix
|
||||
|
||||
(import ./cursors.nix self)
|
||||
(import ./qt.nix self)
|
||||
(import ./hyprpaper.nix self)
|
||||
];
|
||||
|
||||
config.wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
windowrule = [
|
||||
"size 1231 950,title:^(Open Folder)$"
|
||||
"float,title:^(Open Folder)$"
|
||||
|
||||
"size 1231 950,title:^(Open File)$"
|
||||
"float,title:^(Open File)$"
|
||||
];
|
||||
|
||||
layerrule = [
|
||||
"noanim, selection"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./default.nix;
|
||||
}
|
69
modules/desktop/theme/gtk/default.nix
Normal file
69
modules/desktop/theme/gtk/default.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}: {
|
||||
config = let
|
||||
inherit (import ./gradience.nix {inherit pkgs lib;}) gradience;
|
||||
|
||||
cfg = osConfig.roles.desktop;
|
||||
in {
|
||||
home.packages = [
|
||||
pkgs.gnomeExtensions.user-themes
|
||||
];
|
||||
|
||||
# Gtk settings
|
||||
gtk = {
|
||||
enable = true;
|
||||
|
||||
theme = {
|
||||
name = "adw-gtk3";
|
||||
package = pkgs.adw-gtk3;
|
||||
};
|
||||
|
||||
iconTheme = {
|
||||
name = "Flat-Remix-Violet-Dark";
|
||||
package = pkgs.flat-remix-icon-theme;
|
||||
};
|
||||
|
||||
font = {
|
||||
name = "Sans Serif";
|
||||
size = cfg.fontSize;
|
||||
};
|
||||
|
||||
gtk3 = {
|
||||
extraConfig = {
|
||||
"gtk-application-prefer-dark-theme" = 1;
|
||||
};
|
||||
extraCss = "@import url(\"file://${gradience.build}/gtk-3.0/gtk.css\");";
|
||||
};
|
||||
|
||||
gtk4 = {
|
||||
extraConfig = {
|
||||
"gtk-application-prefer-dark-theme" = 1;
|
||||
};
|
||||
extraCss = "@import url(\"file://${gradience.build}/gtk-4.0/gtk.css\");";
|
||||
};
|
||||
};
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/shell/extensions/user-theme" = {
|
||||
name = gradience.shellTheme;
|
||||
};
|
||||
"org/gnome/shell" = {
|
||||
enabled-extensions = [pkgs.gnomeExtensions.user-themes.extensionUuid];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.dataFile.shellTheme = {
|
||||
enable = true;
|
||||
recursive = true;
|
||||
source = "${gradience.build}/gradience-shell";
|
||||
target = "themes/${gradience.shellTheme}";
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./default.nix;
|
||||
}
|
56
modules/desktop/theme/gtk/gradience.nix
Normal file
56
modules/desktop/theme/gtk/gradience.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{pkgs, ...}: {
|
||||
gradience = rec {
|
||||
# https://github.com/V-Mann-Nick/nix-home-manager/blob/main/gnome/theme.nix
|
||||
package = pkgs.gradience.overrideAttrs (old: {
|
||||
version = "0.8.0-beta1";
|
||||
propagatedBuildInputs = old.propagatedBuildInputs ++ [pkgs.python3Packages.libsass];
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://github.com/GradienceTeam/Gradience.git";
|
||||
rev = "06b83cee3b84916ab9812a47a84a28ca43c8e53f";
|
||||
sha256 = "sha256-gdY5QG0STLHY9bw5vI49rY6oNT8Gg8oxqHeEbqM4XfM=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
patches =
|
||||
(old.patches or [])
|
||||
++ [
|
||||
(pkgs.fetchpatch {
|
||||
url = "https://github.com/V-Mann-Nick/nix-home-manager/raw/e68c661f21bf17323f8f0657f3af06c7f837cc07/gnome/gradience.patch";
|
||||
hash = "sha256-CcOd5KXjSSwYan8MwIJ4SBmmMXriBlOLYk5XFADLf6c=";
|
||||
})
|
||||
];
|
||||
});
|
||||
|
||||
# Stub the gnome-shell binary to satisfy the check without downloading Gnome
|
||||
gnomeShellStub = pkgs.writeShellScriptBin "gnome-shell" ''
|
||||
echo "GNOME Shell 45.2"
|
||||
'';
|
||||
|
||||
presets = pkgs.fetchFromGitHub {
|
||||
owner = "GradienceTeam";
|
||||
repo = "Community";
|
||||
rev = "b3628d28164d91b3be1cc4736cd77a19c5da4d74";
|
||||
hash = "sha256-tpS6LpPKedPBvI51bD/g299nYM7gY8C1+AmGza1FJ4w=";
|
||||
};
|
||||
|
||||
build = pkgs.stdenv.mkDerivation {
|
||||
name = "gradience-build";
|
||||
phases = ["buildPhase" "installPhase"];
|
||||
nativeBuildInputs = [gnomeShellStub];
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
export XDG_CURRENT_DESKTOP=GNOME
|
||||
mkdir -p $HOME/.config/presets
|
||||
${package}/bin/gradience-cli apply -p "${presets}/curated/dracula-dark.json" --gtk both
|
||||
${package}/bin/gradience-cli gnome-shell -p "${presets}/curated/dracula-dark.json" -v dark
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r .config/gtk-4.0 $out/
|
||||
cp -r .config/gtk-3.0 $out/
|
||||
cp -r .local/share/themes/gradience-shell $out/
|
||||
'';
|
||||
};
|
||||
|
||||
shellTheme = "gradience-shell";
|
||||
};
|
||||
}
|
30
modules/desktop/theme/hyprpaper.nix
Normal file
30
modules/desktop/theme/hyprpaper.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
self: {
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = let
|
||||
hyprpaper = self.inputs.hyprpaper.packages.${pkgs.system}.default;
|
||||
wallpaper = toString self.scopedPackages.${pkgs.system}.dracula.wallpaper;
|
||||
in {
|
||||
home.packages = [hyprpaper];
|
||||
|
||||
xdg.configFile."hypr/hyprpaper.conf" = {
|
||||
text = lib.hm.generators.toHyprconf {
|
||||
attrs = {
|
||||
ipc = "on";
|
||||
splash = false;
|
||||
|
||||
preload = [wallpaper];
|
||||
|
||||
wallpaper = [
|
||||
",${wallpaper}"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./hyprpaper.nix;
|
||||
}
|
48
modules/desktop/theme/qt.nix
Normal file
48
modules/desktop/theme/qt.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
self: {
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
config = let
|
||||
inherit (self.scopedPackages.${pkgs.system}) dracula;
|
||||
|
||||
cfg = osConfig.roles.desktop;
|
||||
in {
|
||||
home.packages = [
|
||||
pkgs.libsForQt5.qtstyleplugin-kvantum
|
||||
pkgs.kdePackages.qtstyleplugin-kvantum
|
||||
];
|
||||
|
||||
qt = {
|
||||
enable = true;
|
||||
style.name = "kvantum";
|
||||
platformTheme.name = "qtct";
|
||||
};
|
||||
|
||||
xdg.configFile = let
|
||||
floatFont = lib.strings.floatToString cfg.fontSize;
|
||||
qtconf =
|
||||
# ini
|
||||
''
|
||||
[Fonts]
|
||||
fixed="Sans Serif,${floatFont},-1,5,50,0,0,0,0,0"
|
||||
general="Sans Serif,${floatFont},-1,5,50,0,0,0,0,0"
|
||||
|
||||
[Appearance]
|
||||
icon_theme=Flat-Remix-Violet-Dark
|
||||
style='';
|
||||
# The newline before this must be there
|
||||
in {
|
||||
"Kvantum/Dracula/Dracula.kvconfig".source = "${dracula.gtk}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig";
|
||||
"Kvantum/Dracula/Dracula.svg".source = "${dracula.gtk}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.svg";
|
||||
"Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula";
|
||||
|
||||
"qt5ct/qt5ct.conf".text = qtconf + "kvantum";
|
||||
"qt6ct/qt6ct.conf".text = qtconf + "kvantum";
|
||||
};
|
||||
};
|
||||
|
||||
# For accurate stack trace
|
||||
_file = ./qt.nix;
|
||||
}
|
23
modules/desktop/theme/xresources.nix
Normal file
23
modules/desktop/theme/xresources.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{...}: {
|
||||
xresources.extraConfig = ''
|
||||
! Dracula Xresources palette
|
||||
*.foreground: #F8F8F2
|
||||
*.background: #282A36
|
||||
*.color0: #000000
|
||||
*.color8: #4D4D4D
|
||||
*.color1: #FF5555
|
||||
*.color9: #FF6E67
|
||||
*.color2: #50FA7B
|
||||
*.color10: #5AF78E
|
||||
*.color3: #F1FA8C
|
||||
*.color11: #F4F99D
|
||||
*.color4: #BD93F9
|
||||
*.color12: #CAA9FA
|
||||
*.color5: #FF79C6
|
||||
*.color13: #FF92D0
|
||||
*.color6: #8BE9FD
|
||||
*.color14: #9AEDFE
|
||||
*.color7: #BFBFBF
|
||||
*.color15: #E6E6E6
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue