From e0c2d5937705e44bec875074f27a82a5279acc24 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 12 Jun 2023 10:39:46 +0100 Subject: [PATCH] Modify local pkg expressions to remove duplicate names when using --- .../sddm-catppuccin-macchiato/default.nix | 34 +++++----- desktop/sddm.nix | 4 +- home/desktop/gtk.nix | 10 +-- .../desktop/pkgs/candy-icon-theme/default.nix | 54 ++++++++-------- .../desktop/pkgs/delta-icon-theme/default.nix | 63 ++++++++----------- home/desktop/pkgs/rot8/default.nix | 1 - .../pkgs/sweet-folder-theme/default.nix | 54 ++++++++-------- 7 files changed, 102 insertions(+), 118 deletions(-) diff --git a/desktop/pkgs/sddm-catppuccin-macchiato/default.nix b/desktop/pkgs/sddm-catppuccin-macchiato/default.nix index f3dbd9e4..cf0d43ea 100644 --- a/desktop/pkgs/sddm-catppuccin-macchiato/default.nix +++ b/desktop/pkgs/sddm-catppuccin-macchiato/default.nix @@ -1,21 +1,23 @@ { - lib, stdenvNoCC, fetchFromGitHub, -}: { - sddm-catppuccin-macchiato = stdenvNoCC.mkDerivation rec { - pname = "sddm-catppuccin-macchiato-theme"; - version = "1.0"; - dontBuild = true; - installPhase = '' - mkdir -p $out/share/sddm/themes - cp -aR $src/src/catppuccin-macchiato $out/share/sddm/themes/catppuccin-macchiato - ''; - src = fetchFromGitHub { - owner = "catppuccin"; - repo = "sddm"; - rev = "bde6932e1ae0f8fdda76eff5c81ea8d3b7d653c0"; - sha256 = "ceaK/I5lhFz6c+UafQyQVJIzzPxjmsscBgj8130D4dE="; - }; +}: +stdenvNoCC.mkDerivation rec { + pname = "sddm-catppuccin-macchiato-theme"; + version = "1.0"; + dontBuild = true; + + src = fetchFromGitHub { + owner = "catppuccin"; + repo = "sddm"; + rev = "bde6932e1ae0f8fdda76eff5c81ea8d3b7d653c0"; + sha256 = "ceaK/I5lhFz6c+UafQyQVJIzzPxjmsscBgj8130D4dE="; }; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/sddm/themes + cp -aR $src/src/catppuccin-macchiato $out/share/sddm/themes/catppuccin-macchiato + runHook postInstall + ''; } diff --git a/desktop/sddm.nix b/desktop/sddm.nix index 322f69ab..95293e2f 100644 --- a/desktop/sddm.nix +++ b/desktop/sddm.nix @@ -2,9 +2,7 @@ sddm-catppuccin-macchiato = pkgs.callPackage ./pkgs/sddm-catppuccin-macchiato {}; in { imports = [./xserver.nix]; - environment.systemPackages = [ - sddm-catppuccin-macchiato.sddm-catppuccin-macchiato - ]; + environment.systemPackages = [sddm-catppuccin-macchiato]; services.xserver.displayManager.sddm = { enable = true; theme = "catppuccin-macchiato"; diff --git a/home/desktop/gtk.nix b/home/desktop/gtk.nix index 6b221ad5..a0d8b227 100644 --- a/home/desktop/gtk.nix +++ b/home/desktop/gtk.nix @@ -3,12 +3,12 @@ config, ... }: let - candy = pkgs.callPackage ./pkgs/candy-icon-theme {}; - sweet-folder = pkgs.callPackage ./pkgs/sweet-folder-theme {}; + candy-icon-theme = pkgs.callPackage ./pkgs/candy-icon-theme {}; + sweet-folder-theme = pkgs.callPackage ./pkgs/sweet-folder-theme {}; in { home.packages = [ - candy.candy-icon-theme - sweet-folder.sweet-folder-theme + candy-icon-theme + sweet-folder-theme pkgs.breeze-gtk pkgs.gnome.adwaita-icon-theme pkgs.hicolor-icon-theme @@ -20,7 +20,7 @@ in { name = "Catppuccin-Macchiato-Dark-Cursors"; }; iconTheme = { - package = sweet-folder.sweet-folder-theme; + package = sweet-folder-theme.sweet-folder-theme; name = "Sweet-Rainbow"; }; theme = { diff --git a/home/desktop/pkgs/candy-icon-theme/default.nix b/home/desktop/pkgs/candy-icon-theme/default.nix index 0432b4ea..43baeb81 100644 --- a/home/desktop/pkgs/candy-icon-theme/default.nix +++ b/home/desktop/pkgs/candy-icon-theme/default.nix @@ -1,35 +1,33 @@ { - lib, stdenvNoCC, fetchFromGitHub, gtk3, -}: { - candy-icon-theme = stdenvNoCC.mkDerivation rec { - pname = "candy-icon-theme"; - version = "6a35be5cb133c6be8314807f55da3d795e24fb86"; - dontBuild = true; +}: +stdenvNoCC.mkDerivation rec { + pname = "candy-icon-theme"; + version = "6a35be5cb133c6be8314807f55da3d795e24fb86"; + dontBuild = true; - src = fetchFromGitHub { - owner = "EliverLara"; - repo = "candy-icons"; - rev = version; - sha256 = "sha256-M58ts/xyVf+ZDidd4MEp/LlU3vk2imEwOnb0/sVJUYo="; - }; - - nativeBuildInputs = [gtk3]; - - dontDropIconThemeCache = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/icons/Sweet-folders - mv * $out/share/icons/Sweet-folders - - for theme in $out/share/icons/*; do - gtk-update-icon-cache --force $theme - done - - runHook postInstall - ''; + src = fetchFromGitHub { + owner = "EliverLara"; + repo = "candy-icons"; + rev = version; + sha256 = "sha256-M58ts/xyVf+ZDidd4MEp/LlU3vk2imEwOnb0/sVJUYo="; }; + + nativeBuildInputs = [gtk3]; + + dontDropIconThemeCache = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/icons/Sweet-folders + mv * $out/share/icons/Sweet-folders + + for theme in $out/share/icons/*; do + gtk-update-icon-cache --force $theme + done + + runHook postInstall + ''; } diff --git a/home/desktop/pkgs/delta-icon-theme/default.nix b/home/desktop/pkgs/delta-icon-theme/default.nix index 4f5c4639..52316f59 100644 --- a/home/desktop/pkgs/delta-icon-theme/default.nix +++ b/home/desktop/pkgs/delta-icon-theme/default.nix @@ -1,44 +1,33 @@ { - lib, stdenvNoCC, fetchFromGitHub, gtk3, -}: { - delta-icon-theme = stdenvNoCC.mkDerivation rec { - pname = "delta-icon-theme"; - version = "194df98e422c0a81912194808b76712bf5d78803"; - dontBuild = true; +}: +stdenvNoCC.mkDerivation rec { + pname = "delta-icon-theme"; + version = "194df98e422c0a81912194808b76712bf5d78803"; + dontBuild = true; - src = fetchFromGitHub { - owner = "Delta-Icons"; - repo = "linux"; - rev = version; - sha256 = "sha256-SSkI5Aj/TTHfDRYCWe7Ell6cWvPmBUeO/AC4xRrEUvU="; - }; - - nativeBuildInputs = [gtk3]; - - dontDropIconThemeCache = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/icons - mv Delta $out/share/icons - - for theme in $out/share/icons/*; do - gtk-update-icon-cache --force $theme - done - - runHook postInstall - ''; - - # meta = with lib; { - # description = "Delta icon theme"; - # homepage = "https://github.com/Delta-Icons/Linux"; - # license = licenses.gpl3Only; - # # darwin gives hash mismatch in source, probably because of file names differing only in case - # platforms = platforms.linux; - # maintainers = with maintainers; []; - # }; + src = fetchFromGitHub { + owner = "Delta-Icons"; + repo = "linux"; + rev = version; + sha256 = "sha256-SSkI5Aj/TTHfDRYCWe7Ell6cWvPmBUeO/AC4xRrEUvU="; }; + + nativeBuildInputs = [gtk3]; + + dontDropIconThemeCache = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/icons + mv Delta $out/share/icons + + for theme in $out/share/icons/*; do + gtk-update-icon-cache --force $theme + done + + runHook postInstall + ''; } diff --git a/home/desktop/pkgs/rot8/default.nix b/home/desktop/pkgs/rot8/default.nix index 0556e840..29748db1 100644 --- a/home/desktop/pkgs/rot8/default.nix +++ b/home/desktop/pkgs/rot8/default.nix @@ -1,5 +1,4 @@ { - lib, fetchFromGitHub, rustPlatform, }: diff --git a/home/desktop/pkgs/sweet-folder-theme/default.nix b/home/desktop/pkgs/sweet-folder-theme/default.nix index 6c3920de..21ecc826 100644 --- a/home/desktop/pkgs/sweet-folder-theme/default.nix +++ b/home/desktop/pkgs/sweet-folder-theme/default.nix @@ -1,35 +1,33 @@ { - lib, stdenvNoCC, fetchFromGitHub, gtk3, -}: { - sweet-folder-theme = stdenvNoCC.mkDerivation rec { - pname = "sweet-folder-theme"; - version = "b2192ff1412472f036fdf9778c6b9dbcb6c044ec"; - dontBuild = true; +}: +stdenvNoCC.mkDerivation rec { + pname = "sweet-folder-theme"; + version = "b2192ff1412472f036fdf9778c6b9dbcb6c044ec"; + dontBuild = true; - src = fetchFromGitHub { - owner = "EliverLara"; - repo = "Sweet-folders"; - rev = version; - sha256 = "sha256-QexfqXH5a1IEhKBRjWSMdrEvThvLRzd4M32Xti1DCGE="; - }; - - nativeBuildInputs = [gtk3]; - - dontDropIconThemeCache = true; - - installPhase = '' - runHook preInstall - mkdir -p $out/share/icons - mv Sweet-Rainbow $out/share/icons - - for theme in $out/share/icons/*; do - gtk-update-icon-cache --force $theme - done - - runHook postInstall - ''; + src = fetchFromGitHub { + owner = "EliverLara"; + repo = "Sweet-folders"; + rev = version; + sha256 = "sha256-QexfqXH5a1IEhKBRjWSMdrEvThvLRzd4M32Xti1DCGE="; }; + + nativeBuildInputs = [gtk3]; + + dontDropIconThemeCache = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/share/icons + mv Sweet-Rainbow $out/share/icons + + for theme in $out/share/icons/*; do + gtk-update-icon-cache --force $theme + done + + runHook postInstall + ''; }