summaryrefslogtreecommitdiff
path: root/pkgs/line-awesome-css.nix
blob: 45b902e1a35c269881ea6cad67faf213f11c4051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
  stdenv,
  fetchurl,
  fontsRelativeDirectory ? "./webfonts",
  fontDisplay ? "swap",
}:
stdenv.mkDerivation rec {
  name = "line-awesome.css";
  version = "v1.2.1";

  src = fetchurl {
    url = "https://raw.githubusercontent.com/icons8/line-awesome/${version}/dist/line-awesome/css/line-awesome.css";
    sha256 = "sha256:GU24Xz6l3Ww4ZCcL2ByssTe04fHBRz9k2aZVRdj0xm4=";
  };

  phases = ["installPhase"];
  installPhase = ''
    cp $src $out
    substituteInPlace $out --replace '../fonts' '${fontsRelativeDirectory}' \
                           --replace 'font-display: auto' 'font-display: ${fontDisplay}'
  '';
}