I was trying to add a custom font from my local drive (which is not available in NixOS packages).
Here is my font nix file content
{ pkgs }:
pkgs.stdenv.mkDerivation {
pname = "Operator-caska";
version = "1.0";
src = /home/dihan/System/Fonts/operator_caska;
installPhase = ''
mkdir -p $out/share/fonts/truetype/
cp -r $src/*.{ttf,otf} $out/share/fonts/truetype/
'';
meta = with lib; {
description = "Operator Caska";
homepage = "https://github.com/Anant-mishra1729/Operator-caska-Font";
platforms = platforms.all;
};
}
and this is part of my configuration file where I added the font
let
operator-caska-typeface = pkgs.callPackage ./operator_caska.nix {inherit pkgs};
in
fonts = {
fontDir.enable = true;
enableDefaultPackages = false;
packages = with pkgs; [
corefonts
nerd-fonts.noto
noto-fonts
noto-fonts-cjk-sans
noto-fonts-cjk-serif
noto-fonts-color-emoji
noto-fonts-lgc-plus
operator-caska-typeface
];
}
according to documentation and some blogs it is okay. But when I rebuild it shows a problem like this
if I remove {inherit pkgs} it shows this error