nixos-icons: white.svg -> nix-snowflake-white.svg (#343)

These files were renamed in upstream nixos-artwork and merged into nixpkgs 2 days ago.

- ce919b8180
- 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`.
This commit is contained in:
sodiboo 2024-04-20 15:14:34 +02:00 committed by GitHub
parent b36fb34a9c
commit 5749cf1623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 11 deletions

View file

@ -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": {

View file

@ -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<!-- The original NixOS logo from ${oldAttrs.src.url} is licensed under https://creativecommons.org/licenses/by/4.0 and has been modified to match the ${scheme} color scheme. -->' \
logo/white.svg
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
'';
};
});
})];
}