How to override file in a service?

Hi there, I have installed budgie desktop with the traditional services.xserver.desktopManager.budgie.enable = true as per the wiki.

One of the packages (budgie-desktop-10.9.1) installed will create something like /nix/store/5imjisy3vgjxvvgcayqdnpbn9m40z6bd-budgie-desktop-10.9.1/share/icons/hicolor/scalable/actions/budgie-menu-sy mbolic.svg

I want to replace that file with a custom one. Now I have done overrides for packages themselves before, but I could not seem to get it to work with this. I am wondering if this is because the package is coming in via services.xserver......

I do not have the code published to a repo yet (since it is not working). But I tried something like (obviously not complete):

{ user-settings, secrets, lib, pkgs, config, inputs, ... }:
let
  cfg = config.desktops.budgie;
  src = ./budgie-menu-symbolic.svg;
  dest = share/icons/hicolor/scalable/actions;

  overlays = [
    (self: super: {
      budgie-desktop = super.budgie.budgie-desktop.overrideAttrs
        (oldAttrs: rec {
          postInstall = ''
            mkdir -p $out/$dest
            cp $src $out/$dest/budgie-menu-symbolic.svg
            ls $out/$dest
          '';
        });

in {
  options = {
    desktops.budgie.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = "Enable Budgie Desktop.";
    };
  };

  config = lib.mkIf cfg.enable {

services = {.............};

nixpkgs.overlays = overlays;

environment = {
      systemPackages = with pkgs; [
          budgie.budgie-desktop
      ];

........

Any hints?

There is a way to change this in the GUI, but the file is ignored. Even after reboots, etc. Otherwise, the easy way would have been:

"com/solus-project/budgie-panel/instance/budgie-menu/{d4fe5324-a16d-11ef-af99-2cf05da6ad16}" =
          {
            menu-icon = "/home/dustin/dev/nix/nixos/modules/desktops/budgie/budgie-menu.png";
          };

This needs to be ${src} or else you’ll be copying the budgie-desktop drv’s source.

It’s usually better to symlinkJoing the package package you’re trying to modify and then doing your modifications in postBuild. This will save you from rebuilding budgie all the time.

This is unnecessary and does not do what you think it does.

Your approach of overriding the package using an overlay should work.

Make sure you restart your display-manager.service (will kill the session) for changes done to desktop environments and such to become active.

Thanks for confirming the approach! I will have another go at it once I get some time.

Cheers.