Warning for systemd services in nixos config file

I have warnings for some services I wrote in my system log:

jun 30 04:32:01 pierre-nixos systemd[1]: /etc/systemd/system/RestoreAlsaVolume.service:3: Unknown key name 'Type' in section 'Unit', ignoring.
jun 30 04:32:01 pierre-nixos systemd[1]: /etc/systemd/system/ReloadInputRemapperAfterSleep.service:4: Unknown key name 'Type' in section 'Unit', ignoring.

Here are their definitions:

  systemd.services.RestoreAlsaVolume = {
      enable = true;
      description = "Setting SPDIF ALSA volume at 100% after sleep.";
      unitConfig = {
          Type = "simple";
      };
      serviceConfig.User = "pierre";
      script = lib.getExe(pkgs.writeShellApplication {
          name = "set-spdif-volume";
          runtimeInputs = with pkgs; [alsa-utils];
          text = ''
	    amixer -c "PRMA" set PCM,0 100%
            amixer -c "PRMA" set PCM,1 100%
          '';
      });
      wantedBy = [ "suspend.target" ];
  };

  systemd.services.StartInputRemapperDaemonAtLogin = {
      enable = true;
      description = "Start input-remapper daemon after login";
      unitConfig = {
          Type = "simple";
      };
      script = lib.getExe(pkgs.writeShellApplication {
          name = "start-input-mapper-daemon";
          runtimeInputs = with pkgs; [input-remapper procps su];
          text = ''
            until pgrep -u pierre; do
              sleep 1
            done
            sleep 2
            until [ $(pgrep -c -u root "input-remapper") -eq 4 ]; do
              input-remapper-service&
              sleep 1
              input-remapper-helper&
              sleep 1
            done
            su pierre -c "input-remapper-control --command stop-all"
            su pierre -c "input-remapper-control --command autoload"
            sleep infinity
          '';
      });
      wantedBy = [ "default.target" ];
  };

As I know, the type simple exists in systemd. What is wrong with that?

As it says you have it in the wrong section.
It should be in serviceConfig

https://wiki.archlinux.org/title/systemd#Service_types
https://search.nixos.org/options?channel=24.05&show=systemd.services.<name>.serviceConfig&from=0&size=50&sort=relevance&type=packages&query=serviceConfig