From 9d7500c13a43809ef9457b959d8ba456b6be08fd Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Dec 2023 18:47:51 -0500 Subject: [PATCH] refactor: organize dracula-theme overlay --- common/home/bash/programs.nix | 7 +-- common/overlays/dracula-theme/bat.nix | 20 +++++++ common/overlays/dracula-theme/default.nix | 56 ++++---------------- common/overlays/dracula-theme/git.nix | 27 ++++++++++ common/overlays/dracula-theme/plymouth.nix | 29 ++++++++++ common/overlays/dracula-theme/wallpaper.nix | 21 ++++++++ common/overlays/dracula-theme/xresources.nix | 20 +++++++ common/pkgs/input-emulator/default.nix | 3 +- home/theme.nix | 13 ++--- modules/kmscon.nix | 1 + updateSha.sh | 13 +++-- 11 files changed, 144 insertions(+), 66 deletions(-) create mode 100644 common/overlays/dracula-theme/bat.nix create mode 100644 common/overlays/dracula-theme/git.nix create mode 100644 common/overlays/dracula-theme/plymouth.nix create mode 100644 common/overlays/dracula-theme/wallpaper.nix create mode 100644 common/overlays/dracula-theme/xresources.nix diff --git a/common/home/bash/programs.nix b/common/home/bash/programs.nix index 936ab3c..add0500 100644 --- a/common/home/bash/programs.nix +++ b/common/home/bash/programs.nix @@ -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"; }; }; diff --git a/common/overlays/dracula-theme/bat.nix b/common/overlays/dracula-theme/bat.nix new file mode 100644 index 0000000..5e9a9d9 --- /dev/null +++ b/common/overlays/dracula-theme/bat.nix @@ -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 + ''; +} diff --git a/common/overlays/dracula-theme/default.nix b/common/overlays/dracula-theme/default.nix index 0be808a..d4d2e3f 100644 --- a/common/overlays/dracula-theme/default.nix +++ b/common/overlays/dracula-theme/default.nix @@ -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 diff --git a/common/overlays/dracula-theme/git.nix b/common/overlays/dracula-theme/git.nix new file mode 100644 index 0000000..8b904f4 --- /dev/null +++ b/common/overlays/dracula-theme/git.nix @@ -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 + ''; +} diff --git a/common/overlays/dracula-theme/plymouth.nix b/common/overlays/dracula-theme/plymouth.nix new file mode 100644 index 0000000..f43d43f --- /dev/null +++ b/common/overlays/dracula-theme/plymouth.nix @@ -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/ + ''; +} diff --git a/common/overlays/dracula-theme/wallpaper.nix b/common/overlays/dracula-theme/wallpaper.nix new file mode 100644 index 0000000..b300fca --- /dev/null +++ b/common/overlays/dracula-theme/wallpaper.nix @@ -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 + ''; +} diff --git a/common/overlays/dracula-theme/xresources.nix b/common/overlays/dracula-theme/xresources.nix new file mode 100644 index 0000000..c78179b --- /dev/null +++ b/common/overlays/dracula-theme/xresources.nix @@ -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/ + ''; +} diff --git a/common/pkgs/input-emulator/default.nix b/common/pkgs/input-emulator/default.nix index 0779b51..0373712 100644 --- a/common/pkgs/input-emulator/default.nix +++ b/common/pkgs/input-emulator/default.nix @@ -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="; }; diff --git a/home/theme.nix b/home/theme.nix index dc4d261..969968d 100644 --- a/home/theme.nix +++ b/home/theme.nix @@ -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 = '' diff --git a/modules/kmscon.nix b/modules/kmscon.nix index c218da8..693ca0b 100644 --- a/modules/kmscon.nix +++ b/modules/kmscon.nix @@ -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'"; }; } diff --git a/updateSha.sh b/updateSha.sh index f33b9b1..1353121 100755 --- a/updateSha.sh +++ b/updateSha.sh @@ -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"