33 lines
750 B
Nix
33 lines
750 B
Nix
{ sources ? import ../nix/sources.nix
|
|
, nixpkgs ? sources.nixpkgs
|
|
, common-deps ? import ./common-deps.nix { inherit sources; }
|
|
}:
|
|
let
|
|
pkgs = import nixpkgs {};
|
|
ruby = pkgs.ruby;
|
|
env = pkgs.bundlerEnv {
|
|
name = "labelmaker-env";
|
|
gemdir = ./.;
|
|
gemConfig.rmagick = attrs: {
|
|
buildInputs = common-deps;
|
|
};
|
|
buildInputs = common-deps;
|
|
inherit ruby;
|
|
};
|
|
src-drv = pkgs.stdenv.mkDerivation {
|
|
name = "labelmaker-src";
|
|
src = ./.;
|
|
nativeBuildInputs = common-deps ++ [ env ];
|
|
installPhase = ''
|
|
mkdir -p $out/share
|
|
cp -r . $out/share
|
|
'';
|
|
};
|
|
|
|
script = pkgs.writeScriptBin "labelmaker" ''
|
|
#!/bin/sh -e
|
|
${env}/bin/bundle exec ${ruby}/bin/ruby ${src-drv}/share/main.rb
|
|
'';
|
|
in
|
|
script
|