How to configure SDDM sugar-candy theme declaratively

Hello, I am very new to Nixos, and with the help of many same topic on this site, I managed to change to sddm and got sugar-candy running:
Apply an custom theme to SDDM
Fetch package from github

But the problem is that I don’t know how to configure it, because the packages installed is pretty much untouchable, even with sudo privilege.

Here’s my setup:

In configuration.nix:

{ config, pkgs, ... }:

{

environment.systemPackages = with pkgs; [
  # Get sugar-candy from github in sugar-candy.nix then call it here
  (callPackage ./sugar-candy.nix{}).sddm-sugar-candy-theme
  libsForQt5.qt5.qtgraphicaleffects #required for sugar candy
  ];

  # Enable sddm and use theme sugar-candy
  services.xserver.displayManager.sddm = {
    enable = true;
    theme = "sugar-candy";
  };
}

In ./sugar-candy.nix

{ stdenv, fetchFromGitHub }:
{
  sddm-sugar-candy-theme = stdenv.mkDerivation rec {
    pname = "sddm-sugar-candy-theme";
    version = "1.6";
    dontBuild = true;
    installPhase = ''
      mkdir -p $out/share/sddm/themes
      cp -aR $src $out/share/sddm/themes/sugar-candy
    '';
    src = fetchFromGitHub {
      owner = "Kangie";
      repo = "sddm-sugar-candy";
      rev = "v1.6";
      sha256 = "sha256-p2d7I0UBP63baW/q9MexYJQcqSmZ0L5rkwK3n66gmqM=";
    };
  };
}

Now that I got it running, I realize that I need to configure it somehow. But I’m obviously can’t touch it even with sudo privilege.

How do I configure it now that I have it running?

Hello,
I tried something new

{pkgs, stdenv, fetchFromGitHub }:
{
  sddm-sugar-candy-theme = stdenv.mkDerivation rec {
    pname = "sddm-sugar-candy-theme";
    version = "1.6";
    dontBuild = true;
    installPhase = ''
      mkdir -p $out/share/sddm/themes
      cp -aR $src $out/share/sddm/themes/sugar-candy
      cp ${pkgs.writeText "$out/share/sddm/themes/sugar-candy/theme.conf" ''
[General]

Background="$HOME/Pictures/background.*"
      ''} $out/share/sddm/themes/sugar-candy/theme.conf
    '';
    src = fetchFromGitHub {
      owner = "Kangie";
      repo = "sddm-sugar-candy";
      rev = "v1.6";
      sha256 = "sha256-p2d7I0UBP63baW/q9MexYJQcqSmZ0L5rkwK3n66gmqM=";
    };
  };
}

and got

cp: cannot create regular file '/nix/store/84bc0zahsfl41f8dxakgznf9jsz8d1g4-sddm-sugar-candy-theme-1.6/share/sddm/themes/sugar-candy/theme.conf': Permission denied

pretty much predicted that, but is there another way to write to a file that’s fetched from github?
or any alternative wayat all?

In case if you stil needed.

  1. Clone repo to location on your pc/laptop
  2. Edit theme as you like
  3. Change in original sugar-theme.nix (top one)
    fetchFromGitHub to fetchurl
    replace src=fetchFromGitHub to
    src = /path/to_edited_theme/sddm-sugar-candy;
    meta = with stdenv.lib; {
    try rebuild

Linking to my post from a few years ago that might be of help: SDDM background image - #2 by peterhoeg

Full disclosure - I am no longer using that, as my life became infinitely easier when I decided to simply use the stock themes that come with sddm and kde (and stuff in general).