28 lines
622 B
Nix
28 lines
622 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;
|
||
|
}
|