1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-18 21:41:53 +03:00
mobile-nixos/doc/_support/styles/default.nix
2019-11-15 22:02:06 -05:00

37 lines
756 B
Nix

{ stdenv, nodePackages }:
stdenv.mkDerivation {
src = ./.;
pname = "mobile-nixos-website-styles";
version = "2019-11-06";
buildInputs = with nodePackages; [
less
svgo
];
buildPhase = ''
# Skip the source svg files
#rm *.src.svg
# Optimize svg files
for f in *.svg; do svgo $f; done
# Embed svg files in svg.less
for f in *.svg; do
token=''${f^^}
token=''${token//[^A-Z]/_}
token=SVG_''${token/%_SVG/}
substituteInPlace svg.less --replace "@$token" "'$(cat $f)'"
done
mkdir -p $out
lessc index.less $out/styles.css
'';
dontInstall = true;
}
# https://github.com/NixOS/nixpkgs/blob/62e64c1ce9736f35cef6e3935e7891d2ac7cb7e0/pkgs/tools/misc/nix-doc-tools/lib.nix#L57