How to translate packages to nixvim flake?

The following nix flake declares the environment of a nixvim distribution:

{
  description = "deCort.tech NeoVim configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    nixvim.url = "github:nix-community/nixvim";
    pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";

    # color tools
    minty = {
      url = "github:NvChad/minty";
      flake = false;
    };

    volt = {
      url = "github:NvChad/volt";
      flake = false;
    };
  };

  outputs =
    {
      nixpkgs,
      nixvim,
      flake-parts,
      pre-commit-hooks,
      ...
    }@inputs:
    flake-parts.lib.mkFlake { inherit inputs; } {
      systems = [
        "aarch64-linux"
        "x86_64-linux"
        "aarch64-darwin"
        "x86_64-darwin"
      ];

      perSystem =
        {
          system,
          pkgs,
          self',
          lib,
          ...
        }:
        let
          nixvimLib = nixvim.lib.${system};
          pkgs =
            import nixpkgs {
              inherit system;
              config.allowUnfree = true;
            }
            // {
              packages = with pkgs; [
                material-design-icons
                font-awesome
                nerd-fonts._0xproto
                nerd-fonts.symbols-only
              ];
            };
          nixvim' = nixvim.legacyPackages.${system};
          nixvimModule = {
            inherit pkgs;
            module = import ./config; # import the module directly
            # You can use `extraSpecialArgs` to pass additional arguments to your module files
            extraSpecialArgs = {
              inherit inputs;

            };
          };
          nvim = nixvim'.makeNixvimWithModule nixvimModule;

        in
        {
          checks = {
            default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
            pre-commit-check = pre-commit-hooks.lib.${system}.run {
              src = ./.;
              hooks = {
                statix.enable = true;
                nixfmt-rfc-style.enable = true;
              };
            };
          };

          formatter = pkgs.nixfmt-rfc-style;

          packages = {
            default = nvim;
          };

          devShells = {
            default = with pkgs; mkShell { inherit (self'.checks.pre-commit-check) shellHook; };
          };
        };
    };
}

Currently I have the problem that the packages of the nerdfonts, which are needed to display the symbols correctly within nixvim, somehow do not end up in the distribution. Currently all icons are just squares. Does anyone see what I’m doing wrong?

Hello Guelakais,

I wonder if this might work. I usually put my font settings in my configuration.nix file, rather than in the flake.nix. Here is my own example, adapted to your fonts:

  # Install fonts
  fonts = {
    enableDefaultPackages = true;

    # Specific fonts in addition
    packages = with pkgs; [
      nerd-fonts._0xproto
      nerd-fonts.symbols-only
      font-awesome
    ];
  };

This enables the fontconfig to place and register the fonts automatically on the system.