scrapers/default.nix

34 lines
978 B
Nix

{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
gems = bundlerEnv rec {
name = "scrapers";
inherit ruby;
# expects Gemfile, Gemfile.lock and gemset.nix in the same directory
# > nix-shell -p bundler --run 'bundle lock --update'
# > nix-shell -p bundix --run bundix
gemdir = ./.;
};
wrapScript = name: script:
stdenv.mkDerivation {
inherit name script;
buildInputs = [ gems.wrappedRuby ];
buildCommand = ''
install -D -m755 ${script} $out/bin/${name}
patchShebangs $out/bin/${name}
'';
};
in {
xerox = wrapScript "xerox" ./xerox/scrape.rb;
luftdaten = wrapScript "luftdaten" ./luftdaten/scrape.rb;
luftqualitaet = wrapScript "luftqualitaet" ./luftqualitaet/scrape.rb;
fhem = wrapScript "fhem" ./fhem/scrape.rb;
matemat = wrapScript "matemat" ./matemat/scrape.rb;
freifunk_node = wrapScript "freifunk_node" ./freifunk_node/scrape.rb;
impfee = wrapScript "impfee" ./impfee/scrape.rb;
}