From 7a3fb64fcc9fc88c9c0b6391f35bd0f0178acfdc Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 16 Oct 2023 12:50:00 -0400 Subject: [PATCH] feat(hyprpaper): get wallpaper with fetchurl and set config declaratively --- common/overlays/dracula-theme.nix | 17 +++++++++++++++++ common/overlays/spotifywm.nix | 2 -- hosts/wim/config/hypr/hyprpaper.conf | 2 -- hosts/wim/home/hyprland.nix | 8 ++++++-- 4 files changed, 23 insertions(+), 6 deletions(-) delete mode 100644 hosts/wim/config/hypr/hyprpaper.conf diff --git a/common/overlays/dracula-theme.nix b/common/overlays/dracula-theme.nix index 736f7bdb..103e11bb 100644 --- a/common/overlays/dracula-theme.nix +++ b/common/overlays/dracula-theme.nix @@ -15,6 +15,11 @@ final: prev: { 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="; + }; + src = prev.fetchFromGitHub { owner = "dracula"; repo = "gtk"; @@ -28,21 +33,33 @@ final: prev: { 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 + 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/ + + + # ------------------------------------------- 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 diff --git a/common/overlays/spotifywm.nix b/common/overlays/spotifywm.nix index 4f0a7844..4478b7a7 100644 --- a/common/overlays/spotifywm.nix +++ b/common/overlays/spotifywm.nix @@ -1,7 +1,5 @@ final: prev: { spotifywm = prev.spotifywm.overrideAttrs (oldAttrs: rec { - - installPhase = '' runHook preInstall diff --git a/hosts/wim/config/hypr/hyprpaper.conf b/hosts/wim/config/hypr/hyprpaper.conf deleted file mode 100644 index d37a22fa..00000000 --- a/hosts/wim/config/hypr/hyprpaper.conf +++ /dev/null @@ -1,2 +0,0 @@ -preload = ~/Pictures/BG/bonzai.jpg -wallpaper = eDP-1, ~/Pictures/BG/bonzai.jpg diff --git a/hosts/wim/home/hyprland.nix b/hosts/wim/home/hyprland.nix index baf190eb..fd809d05 100644 --- a/hosts/wim/home/hyprland.nix +++ b/hosts/wim/home/hyprland.nix @@ -45,8 +45,12 @@ in }; xdg.configFile = { - "hypr/main.conf".source = symlink "${configDir}/hypr/main.conf"; - "hypr/hyprpaper.conf".source = symlink "${configDir}/hypr/hyprpaper.conf"; + "hypr/main.conf".source = symlink "${configDir}/hypr/main.conf"; + + "hypr/hyprpaper.conf".text = '' + preload = ${pkgs.dracula-theme}/wallpapers/waves.png + wallpaper = eDP-1, ${pkgs.dracula-theme}/wallpapers/waves.png + ''; }; home.packages = [