1 { stdenvNoCC, lib, bower2nix, cacert }:
3 bowerVersion = version:
5 components = lib.splitString "#" version;
6 hash = lib.last components;
7 ver = if builtins.length components == 1 then (cleanName version) else hash;
10 cleanName = name: lib.replaceStrings ["/" ":"] ["-" "-"] name;
12 fetchbower = name: version: target: outputHash: stdenvNoCC.mkDerivation {
13 name = "${cleanName name}-${bowerVersion version}";
15 fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"
16 # In some cases, the result of fetchBower is different depending
17 # on the output directory (e.g. if the bower package contains
18 # symlinks). So use a local output directory before copying to
22 outputHashMode = "recursive";
23 outputHashAlgo = "sha256";
25 nativeBuildInputs = [ bower2nix cacert ];