refactor: move dracula from common overlays to pkgs
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-06-08 23:40:44 -04:00
parent fe7b03dd4a
commit a51db7b00f
23 changed files with 154 additions and 107 deletions

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
config, config,
self,
... ...
}: { }: {
programs = { programs = {
@ -41,15 +42,10 @@
bat = { bat = {
enable = true; enable = true;
config = {
theme = "dracula-bat"; config.theme = "dracula-bat";
}; themes.dracula-bat.src = self.packages.${pkgs.system}.dracula.bat;
themes = {
dracula-bat = {
src = pkgs.dracula-theme;
file = "bat";
};
};
extraPackages = with pkgs.bat-extras; [ extraPackages = with pkgs.bat-extras; [
batman batman
]; ];

View file

@ -1,11 +1,15 @@
{pkgs, ...}: { {
pkgs,
self,
...
}: {
programs = { programs = {
git = { git = {
enable = true; enable = true;
lfs.enable = true; lfs.enable = true;
includes = [ includes = [
{path = "${pkgs.dracula-theme}/git-colors";} {path = toString self.packages.${pkgs.system}.dracula.git;}
{ {
condition = "hasconfig:remote.*.url:git@github.com:*/**"; condition = "hasconfig:remote.*.url:git@github.com:*/**";

View file

@ -13,7 +13,6 @@
]) ])
++ (with pkgs; [ ++ (with pkgs; [
dig.dnsutils dig.dnsutils
dracula-theme
imagemagick imagemagick
killall killall
mosh mosh

View file

@ -2,9 +2,7 @@
grim-hyprland, grim-hyprland,
nixpkgs-wayland, nixpkgs-wayland,
... ...
} @ inputs: [ }: [
(import ./dracula-theme inputs)
grim-hyprland.overlays.default grim-hyprland.overlays.default
nixpkgs-wayland.overlay nixpkgs-wayland.overlay
] ]

View file

@ -1,46 +0,0 @@
{
bat-theme-src,
gtk-theme-src,
xresources-src,
...
} @ inputs: (final: prev: {
dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: let
git-colors = prev.callPackage ./git.nix inputs;
plymouth = prev.callPackage ./plymouth.nix inputs;
wallpaper = prev.fetchurl (import ./wallpaper.nix);
in {
version = gtk-theme-src.shortRev;
src = gtk-theme-src;
installPhase = ''
runHook preInstall
mkdir -p $out/share/plymouth/themes $out/wallpapers
cp -a ${wallpaper} $out/wallpapers/waves.png
cp -a ${bat-theme-src}/Dracula.tmTheme $out/bat
cp -a ${git-colors}/git-colors $out/git-colors
cp -a ${plymouth}/share/plymouth/themes/dracula $out/share/plymouth/themes/
cp -a ${xresources-src}/Xresources $out/xres
# -------------------------------------------
mkdir -p $out/share/themes/Dracula
cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula
cp -a kde/{color-schemes,plasma} $out/share/
cp -a kde/kvantum $out/share/Kvantum
mkdir -p $out/share/aurorae/themes
cp -a kde/aurorae/* $out/share/aurorae/themes/
mkdir -p $out/share/sddm/themes
cp -a kde/sddm/* $out/share/sddm/themes/
mkdir -p $out/share/icons/Dracula-cursors
mv kde/cursors/Dracula-cursors/index.theme $out/share/icons/Dracula-cursors/cursor.theme
mv kde/cursors/Dracula-cursors/cursors $out/share/icons/Dracula-cursors/cursors
runHook postInstall
'';
});
})

View file

@ -1,23 +0,0 @@
{
stdenv,
git-theme-src,
...
}:
stdenv.mkDerivation {
name = "dracula-git";
version = git-theme-src.shortRev;
src = git-theme-src;
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

@ -1878,6 +1878,7 @@
"piper-src": "piper-src", "piper-src": "piper-src",
"pokemon-colorscripts-src": "pokemon-colorscripts-src", "pokemon-colorscripts-src": "pokemon-colorscripts-src",
"secrets": "secrets", "secrets": "secrets",
"sioyek-theme-src": "sioyek-theme-src",
"sops-nix": "sops-nix_2", "sops-nix": "sops-nix_2",
"stylelint-lsp": "stylelint-lsp", "stylelint-lsp": "stylelint-lsp",
"subsync": "subsync", "subsync": "subsync",
@ -1925,6 +1926,22 @@
"url": "ssh://git@git.nelim.org/matt1432/nixos-secrets" "url": "ssh://git@git.nelim.org/matt1432/nixos-secrets"
} }
}, },
"sioyek-theme-src": {
"flake": false,
"locked": {
"lastModified": 1669165291,
"narHash": "sha256-+HzxZA8Bb+cGogK+w4JES4ZFG+ueXEAuLu+0T18fvbc=",
"owner": "dracula",
"repo": "sioyek",
"rev": "b832ab04d880fbe243c0fe9043612be61226426e",
"type": "github"
},
"original": {
"owner": "dracula",
"repo": "sioyek",
"type": "github"
}
},
"sops-nix": { "sops-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View file

@ -283,6 +283,12 @@
type = "git"; type = "git";
url = "ssh://git@git.nelim.org/matt1432/nixos-secrets"; url = "ssh://git@git.nelim.org/matt1432/nixos-secrets";
}; };
sioyek-theme-src = {
flake = false;
owner = "dracula";
repo = "sioyek";
type = "github";
};
sops-nix = { sops-nix = {
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
owner = "Mic92"; owner = "Mic92";

View file

@ -1,4 +1,10 @@
{pkgs, ...}: { {
pkgs,
self,
...
}: let
inherit (self.packages.${pkgs.system}) dracula;
in {
imports = [ imports = [
./gtk.nix ./gtk.nix
./qt.nix ./qt.nix
@ -6,7 +12,7 @@
home.pointerCursor = { home.pointerCursor = {
name = "Dracula-cursors"; name = "Dracula-cursors";
package = pkgs.dracula-theme; package = dracula.gtk;
size = 24; size = 24;
gtk.enable = true; gtk.enable = true;
@ -19,5 +25,5 @@
xresources.extraConfig = xresources.extraConfig =
builtins.readFile builtins.readFile
"${pkgs.dracula-theme}/xres"; "${dracula.xresources}";
} }

View file

@ -1,10 +1,12 @@
{ {
pkgs,
lib,
config, config,
lib,
pkgs,
self,
... ...
}: let }: let
inherit (config.vars) fontSize; inherit (config.vars) fontSize;
inherit (self.packages.${pkgs.system}) dracula;
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
libsForQt5.qtstyleplugin-kvantum libsForQt5.qtstyleplugin-kvantum
@ -32,8 +34,8 @@ in {
style=''; style='';
# The newline before this must be there # The newline before this must be there
in { in {
"Kvantum/Dracula/Dracula.kvconfig".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig"; "Kvantum/Dracula/Dracula.kvconfig".source = "${dracula.gtk}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.kvconfig";
"Kvantum/Dracula/Dracula.svg".source = "${pkgs.dracula-theme}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.svg"; "Kvantum/Dracula/Dracula.svg".source = "${dracula.gtk}/share/Kvantum/Dracula-purple-solid/Dracula-purple-solid.svg";
"Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula"; "Kvantum/kvantum.kvconfig".text = "[General]\ntheme=Dracula";
"qt5ct/qt5ct.conf".text = qtconf + "kvantum"; "qt5ct/qt5ct.conf".text = qtconf + "kvantum";

View file

@ -1,17 +1,17 @@
{ {
pkgs, pkgs,
self,
wpaperd, wpaperd,
... ...
}: let }: let
inherit (pkgs.writers) writeTOML; inherit (pkgs.writers) writeTOML;
wpaperdPkg = wpaperd.packages.${pkgs.system}.default; wpaperdPkg = wpaperd.packages.${pkgs.system}.default;
wallpaper = "${pkgs.dracula-theme}/wallpapers/waves.png";
in { in {
home.packages = [wpaperdPkg]; home.packages = [wpaperdPkg];
xdg.configFile."wpaperd/config.toml".source = writeTOML "config.toml" { xdg.configFile."wpaperd/config.toml".source = writeTOML "config.toml" {
default = { default = {
path = wallpaper; path = toString self.packages.${pkgs.system}.dracula.wallpaper;
mode = "stretch"; mode = "stretch";
}; };
}; };

View file

@ -281,6 +281,11 @@ let
owner = "dracula"; owner = "dracula";
repo = "xresources"; repo = "xresources";
} }
{
name = "sioyek-theme-src";
owner = "dracula";
repo = "sioyek";
}
]; ];
in { in {
inherit mkDep mkInput mkSrc; inherit mkDep mkInput mkSrc;

View file

@ -3,6 +3,7 @@
jellyfin-flake, jellyfin-flake,
lib, lib,
pkgs, pkgs,
self,
... ...
}: let }: let
inherit (lib) makeLibraryPath optionalString; inherit (lib) makeLibraryPath optionalString;
@ -51,19 +52,11 @@ in {
programs.sioyek = { programs.sioyek = {
enable = true; enable = true;
config = let config = {
# TODO: put this with the rest of the themes
dracula-theme = pkgs.fetchFromGitHub {
owner = "dracula";
repo = "sioyek";
rev = "b832ab04d880fbe243c0fe9043612be61226426e";
hash = "sha256-+HzxZA8Bb+cGogK+w4JES4ZFG+ueXEAuLu+0T18fvbc=";
};
in {
startup_commands = "toggle_custom_color"; startup_commands = "toggle_custom_color";
ui_font = "JetBrainsMono Nerd Font Mono Regular"; ui_font = "JetBrainsMono Nerd Font Mono Regular";
font_size = "24"; font_size = "24";
source = "${dracula-theme}/dracula.config"; source = toString self.packages.${pkgs.system}.dracula.sioyek;
}; };
}; };

View file

@ -1,4 +1,8 @@
{pkgs, ...}: { {
pkgs,
self,
...
}: {
boot = { boot = {
initrd = { initrd = {
verbose = false; verbose = false;
@ -20,7 +24,7 @@
plymouth = { plymouth = {
enable = true; enable = true;
themePackages = [pkgs.dracula-theme]; themePackages = [self.packages.${pkgs.system}.dracula.plymouth];
theme = "dracula"; theme = "dracula";
}; };
}; };

View file

@ -4,13 +4,15 @@
pam-fprint-grosshack-src, pam-fprint-grosshack-src,
pokemon-colorscripts-src, pokemon-colorscripts-src,
... ...
}: { } @ inputs: {
coloryou = pkgs.callPackage ./coloryou {}; coloryou = pkgs.callPackage ./coloryou {};
curseforge-server-downloader = pkgs.callPackage ./curseforge-server-downloader { curseforge-server-downloader = pkgs.callPackage ./curseforge-server-downloader {
inherit curseforge-server-downloader-src; inherit curseforge-server-downloader-src;
}; };
dracula = import ./dracula inputs;
pam-fprint-grosshack = pkgs.callPackage ./pam-fprint-grosshack { pam-fprint-grosshack = pkgs.callPackage ./pam-fprint-grosshack {
inherit pam-fprint-grosshack-src; inherit pam-fprint-grosshack-src;
}; };

15
pkgs/dracula/bat.nix Normal file
View file

@ -0,0 +1,15 @@
{
bat-theme-src,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "dracula-bat";
version = bat-theme-src.shortRev;
src = bat-theme-src;
installPhase = ''
cat ./Dracula.tmTheme > $out
'';
}

9
pkgs/dracula/default.nix Normal file
View file

@ -0,0 +1,9 @@
{pkgs, ...} @ inputs: {
bat = pkgs.callPackage ./bat.nix {inherit (inputs) bat-theme-src;};
git = pkgs.callPackage ./git.nix {inherit (inputs) git-theme-src;};
gtk = import ./gtk.nix {inherit (inputs) gtk-theme-src pkgs;};
plymouth = pkgs.callPackage ./plymouth.nix {inherit (inputs) dracula-plymouth-src;};
sioyek = pkgs.callPackage ./sioyek.nix {inherit (inputs) sioyek-theme-src;};
wallpaper = pkgs.fetchurl (import ./wallpaper.nix);
xresources = pkgs.callPackage ./xresources.nix {inherit (inputs) xresources-src;};
}

21
pkgs/dracula/git.nix Normal file
View file

@ -0,0 +1,21 @@
{
stdenv,
git-theme-src,
...
}:
stdenv.mkDerivation {
pname = "dracula-git";
version = git-theme-src.shortRev;
src = git-theme-src;
installPhase = ''
chmod 777 ./config/gitconfig
# Remove every line above 'Dracula Dark Theme'
line=$(grep -n 'Dracula Dark Theme' ./config/gitconfig | cut -d: -f1)
sed -i "1,$((line-1))d" ./config/gitconfig
cat ./config/gitconfig > $out
'';
}

9
pkgs/dracula/gtk.nix Normal file
View file

@ -0,0 +1,9 @@
{
gtk-theme-src,
pkgs,
...
}:
pkgs.dracula-theme.overrideAttrs {
version = gtk-theme-src.shortRev;
src = gtk-theme-src;
}

View file

@ -4,7 +4,7 @@
... ...
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "dracula-plymouth"; pname = "dracula-plymouth";
version = dracula-plymouth-src.shortRev; version = dracula-plymouth-src.shortRev;
src = dracula-plymouth-src; src = dracula-plymouth-src;

15
pkgs/dracula/sioyek.nix Normal file
View file

@ -0,0 +1,15 @@
{
sioyek-theme-src,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "dracula-sioyek";
version = sioyek-theme-src.shortRev;
src = sioyek-theme-src;
installPhase = ''
cat ./dracula.config > $out
'';
}

View file

@ -0,0 +1,15 @@
{
xresources-src,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "dracula-xresources";
version = xresources-src.shortRev;
src = xresources-src;
installPhase = ''
cat ./Xresources > $out
'';
}