diff --git a/modules/nixos-icons/nixos.nix b/modules/nixos-icons/nixos.nix new file mode 100644 index 00000000..cce696d8 --- /dev/null +++ b/modules/nixos-icons/nixos.nix @@ -0,0 +1,24 @@ +{ pkgs, config, lib, ... }: + +with config.lib.stylix.colors; + +{ + options.stylix.targets.nixos-icons.enable = + config.lib.stylix.mkEnableTarget "the NixOS logo" true; + + 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}' + + # Insert attribution comment after the XML prolog + sed \ + --in-place \ + '2i' \ + logo/white.svg + + ${lib.getExe pkgs.resvg} logo/white.svg logo/white.png + ''; + }); + })]; +}