From 5749cf162340b230e86fa75571b3cb6ce7f11441 Mon Sep 17 00:00:00 2001 From: sodiboo <37938646+sodiboo@users.noreply.github.com> Date: Sat, 20 Apr 2024 15:14:34 +0200 Subject: [PATCH] nixos-icons: `white.svg` -> `nix-snowflake-white.svg` (#343) These files were renamed in upstream nixos-artwork and merged into nixpkgs 2 days ago. - https://github.com/NixOS/nixos-artwork/commit/ce919b818047ac481b8f1bfb9bee377e2b2889e2 - https://github.com/NixOS/nixpkgs/pull/303068 Additionally, the source root of the package has been moved, so we patch the `src` directly rather than using mkDerivation's `patchPhase`. --- flake.lock | 6 +++--- modules/nixos-icons/nixos.nix | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 72f49b0..c389d3e 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1711715736, - "narHash": "sha256-9slQ609YqT9bT/MNX9+5k5jltL9zgpn36DpFB7TkttM=", + "lastModified": 1713596654, + "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "807c549feabce7eddbf259dbdcec9e0600a0660d", + "rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be", "type": "github" }, "original": { diff --git a/modules/nixos-icons/nixos.nix b/modules/nixos-icons/nixos.nix index cce696d..f7a93f6 100644 --- a/modules/nixos-icons/nixos.nix +++ b/modules/nixos-icons/nixos.nix @@ -8,17 +8,20 @@ with config.lib.stylix.colors; config.nixpkgs.overlays = lib.mkIf config.stylix.targets.nixos-icons.enable [(self: super: { nixos-icons = super.nixos-icons.overrideAttrs (oldAttrs: { - patchPhase = '' - substituteInPlace logo/white.svg --replace-fail '#ffffff' '#${base05}' + src = pkgs.applyPatches { + src = oldAttrs.src; + prePatch = '' + substituteInPlace logo/nix-snowflake-white.svg --replace-fail '#ffffff' '#${base05}' - # Insert attribution comment after the XML prolog - sed \ - --in-place \ - '2i' \ - logo/white.svg + # Insert attribution comment after the XML prolog + sed \ + --in-place \ + '2i' \ + logo/nix-snowflake-white.svg - ${lib.getExe pkgs.resvg} logo/white.svg logo/white.png + ${lib.getExe pkgs.resvg} logo/nix-snowflake-white.svg logo/nix-snowflake-white.png ''; + }; }); })]; }