Skip to content

Instantly share code, notes, and snippets.

@dmjio

dmjio/app.nix Secret

Created February 8, 2020 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmjio/c6e2ed6b3e8925c18bf8e7d92bc2ea52 to your computer and use it in GitHub Desktop.
Save dmjio/c6e2ed6b3e8925c18bf8e7d92bc2ea52 to your computer and use it in GitHub Desktop.
{ tree, runCommand, python3, makeWrapper, fetchFromGitHub, maven, lib, openjdk, writeTextFile, ... }:
let
app-src =
builtins.fetchGit {
url = "ssh://git@github.com/some/pkg";
rev = "0afc587394dd055be8278a8224aa03be68577kf3";
};
in
self: super: rec
app = super.buildPythonPackage rec {
pname = "app";
version = "1.0";
doCheck = false;
src = app-src;
buildInputs = with super; [ ];
propagatedBuildInputs = with super; [ openjdk maven dill pandas ];
};
app-exec =
let
python = python3.withPackages (ps: with ps; [ app ]);
in runCommand "app-exec" {
buildInputs = [ makeWrapper ];
} ''
makeWrapper ${python}/bin/python $out --add-flags ${./../../path/to/app.py}
'';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment