refactor: organize dracula-theme overlay

This commit is contained in:
matt1432 2023-12-13 18:47:51 -05:00
parent 5143bb06c8
commit 9d7500c13a
11 changed files with 144 additions and 66 deletions

View file

@ -40,12 +40,7 @@
};
themes = {
dracula-bat = {
src = pkgs.fetchFromGitHub {
owner = "matt1432";
repo = "bat";
rev = "270bce892537311ac92494a2a7663e3ecf772092";
hash = "sha256-UyZ3WFfrEEBjtdb//5waVItmjKorkOiNGtu9eeB3lOw=";
};
src = pkgs.dracula-theme;
file = "Dracula.tmTheme";
};
};

View file

@ -0,0 +1,20 @@
{
stdenv,
fetchFromGitHub,
...
}:
stdenv.mkDerivation {
name = "dracula-bat";
src = fetchFromGitHub {
owner = "matt1432";
repo = "bat";
rev = "270bce892537311ac92494a2a7663e3ecf772092";
hash = "sha256-UyZ3WFfrEEBjtdb//5waVItmjKorkOiNGtu9eeB3lOw=";
};
installPhase = ''
mkdir -p $out/bat
cp -a ./Dracula.tmTheme $out/bat
'';
}

View file

@ -1,25 +1,10 @@
(final: prev: {
dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: let
plymouth = prev.fetchFromGitHub {
owner = "dracula";
repo = "plymouth";
rev = "37aa09b27ecee4a825b43d2c1d20b502e8f19c96";
hash = "sha256-7YwkBzkAND9lfH2ewuwna1zUkQStBBx4JHGw3/+svhA=";
};
dracula-script = ./dracula-plymouth.patch;
git-colors = prev.fetchFromGitHub {
owner = "dracula";
repo = "git";
rev = "924d5fc32f7ca15d0dd3a8d2cf1747e81e063c73";
hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM=";
};
wallpaper = prev.fetchurl {
url = "https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true";
hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk=";
};
bat-colors = prev.callPackage ./bat.nix prev;
git-colors = prev.callPackage ./git.nix prev;
plymouth = prev.callPackage ./plymouth.nix prev;
wallpaper = prev.callPackage ./wallpaper.nix prev;
Xresources = prev.callPackage ./xresources.nix prev;
in {
src = prev.fetchFromGitHub {
owner = "dracula";
@ -31,34 +16,13 @@
installPhase = ''
runHook preInstall
# Git colors
cp -a ${git-colors}/config/gitconfig ./git-colors
chmod 777 ./git-colors
line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1)
sed -i "1,$((line-1))d" ./git-colors
mkdir -p $out
cp -a ./git-colors $out
# Plymouth
cp -a ${plymouth}/dracula ./dracula
chmod 777 ./dracula
rm ./dracula/dracula.script
cp -a ${dracula-script} ./dracula/dracula.script
sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth
mkdir -p $out/share/plymouth/themes
cp -a ./dracula $out/share/plymouth/themes/
# Wallpapers
cp -a ${wallpaper} ./waves.png
mkdir -p $out/wallpapers
cp -a ./waves.png $out/wallpapers/
cp -a ${bat-colors}/bat $out/bat
cp -a ${git-colors}/git-colors $out/git-colors
cp -a ${plymouth}/share/plymouth/themes/dracula $out/share/plymouth/themes/
cp -a ${wallpaper}/wallpapers $out/wallpapers
cp -a ${Xresources}/xres $out/xres
# -------------------------------------------
mkdir -p $out/share/themes/Dracula

View file

@ -0,0 +1,27 @@
{
stdenv,
fetchFromGitHub,
...
}:
stdenv.mkDerivation {
name = "dracula-git";
src = fetchFromGitHub {
owner = "dracula";
repo = "git";
rev = "924d5fc32f7ca15d0dd3a8d2cf1747e81e063c73";
hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM=";
};
installPhase = ''
# Git colors
cp -a ./config/gitconfig ./git-colors
chmod 777 ./git-colors
line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1)
sed -i "1,$((line-1))d" ./git-colors
mkdir $out
cp -a ./git-colors $out
'';
}

View file

@ -0,0 +1,29 @@
{
stdenv,
fetchFromGitHub,
...
}:
stdenv.mkDerivation {
name = "dracula-plymouth";
src = fetchFromGitHub {
owner = "dracula";
repo = "plymouth";
rev = "37aa09b27ecee4a825b43d2c1d20b502e8f19c96";
hash = "sha256-7YwkBzkAND9lfH2ewuwna1zUkQStBBx4JHGw3/+svhA=";
};
installPhase = let
dracula-script = ./dracula-plymouth.patch;
in ''
chmod 777 ./dracula
rm ./dracula/dracula.script
cp -a ${dracula-script} ./dracula/dracula.script
sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth
mkdir -p $out/share/plymouth/themes
cp -a ./dracula $out/share/plymouth/themes/
'';
}

View file

@ -0,0 +1,21 @@
{
stdenv,
fetchurl,
...
}:
stdenv.mkDerivation {
name = "dracula-wallpaper";
src = fetchurl {
url = "https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true";
hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk=";
};
phases = ["installPhase"];
installPhase = ''
mv ./* ./waves.png
mkdir -p $out/wallpapers
cp -a ./waves.png $out/wallpapers
'';
}

View file

@ -0,0 +1,20 @@
{
stdenv,
fetchFromGitHub,
...
}:
stdenv.mkDerivation {
name = "dracula-xresources";
src = fetchFromGitHub {
owner = "dracula";
repo = "xresources";
rev = "539ef24e9b0c5498a82d59bfa2bad9b618d832a3";
sha256 = "sha256-6fltsAluqOqYIh2NX0I/LC3WCWkb9Fn8PH6LNLBQbrY=";
};
installPhase = ''
mkdir -p $out/xres
cp -a ./Xresources $out/xres/
'';
}

View file

@ -9,12 +9,11 @@
}:
stdenv.mkDerivation rec {
pname = "input-emulator";
version = "6c35040e6fc4f65ce0519ee76d00d60490bcb987";
src = fetchFromGitHub {
owner = "tio";
repo = pname;
rev = version;
rev = "6c35040e6fc4f65ce0519ee76d00d60490bcb987";
sha256 = "sha256-Im0RADqRwlZ/RiZFSVp+HwnWoLdcpRp0Ej6RP0GY0+c=";
};

View file

@ -3,14 +3,7 @@
lib,
config,
...
}: let
dracula-xresources = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "xresources";
rev = "539ef24e9b0c5498a82d59bfa2bad9b618d832a3";
sha256 = "sha256-6fltsAluqOqYIh2NX0I/LC3WCWkb9Fn8PH6LNLBQbrY=";
};
in {
}: {
home.pointerCursor = {
name = "Dracula-cursors";
package = pkgs.dracula-theme;
@ -51,7 +44,9 @@ in {
platformTheme = "qtct";
};
xresources.extraConfig = builtins.readFile "${dracula-xresources}/Xresources";
xresources.extraConfig =
builtins.readFile
"${pkgs.dracula-theme}/xres/Xresources";
xdg.configFile = let
qtconf = ''

View file

@ -4,6 +4,7 @@
hwRender = false;
# FIXME: https://github.com/Aetf/kmscon/issues/18 // Icons not rendering properly
# FIXME: https://github.com/Aetf/kmscon/issues/56 // Mouse cursor stays
# FIXME: wrong keyboard layout
extraOptions = "--font-size 12.5 --font-dpi 170 --font-name 'JetBrainsMono Nerd Font'";
};
}

View file

@ -11,11 +11,18 @@ parseNurl() {
# TODO
# https://github.com/dracula/xresources
# https://github.com/dracula/plymouth
#
# https://github.com/dracula/gtk
# https://gitlab.com/mishakmak/pam-fprint-grosshack
# https://github.com/dracula/plymouth
# https://github.com/matt1432/bat
#
# https://github.com/aynp/dracula-wallpapers/blob/main/Art/4k/Waves%201.png?raw=true
#
# https://github.com/dasJ/spotifywm
#
# https://github.com/tio/input-emulator
# https://gitlab.com/mishakmak/pam-fprint-grosshack
# https://gitlab.com/phoneybadger/pokemon-colorscripts
updateFFZ() {
FILE="/home/matt/.nix/home/firefox/addons/default.nix"