mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-19 22:11:29 +03:00
37 lines
756 B
Nix
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
|