Having trouble installing fonts with derivation

I looked at this guide for installing custom fonts: Packing Custom Fonts for NixOS | Ali Oguzhan Yildiz. I have this in a file called Iosevka.nix:

{ pkgs }:

pkgs.stdenv.mkDerivation {
  pname = "Iosevka Font";
  version = "1.0";

  src = ./Iosevka-Font;

  installPhase = ''
    runHook preInstall
    mkdir - p $out
    install -Dm644 Iosevka-Font/*.ttf -t $out/share/fonts/truetype
    runHook postInstall
  '';
}

And this in my configuration.nix:

fonts = 
enableDefaultPackages = true;
enableGhostscriptFonts = true;
packages = with pkgs; [
(pkgs.callPackage ./Iosevka.nix { })
];
};

I got this error:

error: builder for '/nix/store/47fmzmy2qa03hajp2gg6lj0yb24wsbiy-Iosevka-Font-1.0.drv' failed with exit code 1;
       last 12 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/rvhjgz185y24kph48gypcy7qzimzqg4g-Iosevka-Font
       > source root is Iosevka-Font
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > no Makefile or custom buildPhase, doing nothing
       > Running phase: installPhase
       > install: missing file operand
       > Try 'install --help' for more information.
       For full logs, run:
         nix log /nix/store/47fmzmy2qa03hajp2gg6lj0yb24wsbiy-Iosevka-Font-1.0.drv
error: 1 dependencies of derivation '/nix/store/k5c7fqzfwwikls82m4k2dksi3qn9ygb6-X11-fonts.drv' failed to build

Edit: I got an answer on this comment, and edited Iosevka.nix to this:

{ pkgs }:

pkgs.runCommandLocal "my-iosevka-fonts" {} ''
  mkdir -p $out/share/fonts/truetype
  cp -r ${./Iosevka-Font} $out/share/fonts/truetype
''{ pkgs }:

pkgs.runCommandLocal "my-iosevka-fonts" {} ''
  mkdir -p $out/share/fonts/truetype
  cp -r ${./Iosevka-Font} $out/share/fonts/truetype
''