@@ -2,11 +2,39 @@ with (import ./pypi2nixpkgs/nixpkgs.nix) { };
22let
33 version = builtins . head ( builtins . match ".*'([0-9]+.[0-9]+(.[0-9]+)?)'.*"
44 ( builtins . readFile ./faraday/__init__.py ) ) ;
5+
6+ product = if builtins . pathExists ./pypi2nixpkgs_black then
7+ "corp"
8+ else if builtins . pathExists ./pypi2nixpkgs_pink then
9+ "pro"
10+ else
11+ "community" ;
12+
513in { dockerName ? "registry.gitlab.com/faradaysec/faraday" , dockerTag ? version
6- } : {
14+
15+ # If true, will ignore the contents of the last commit as source, ignoring
16+ # uncommited changes. Recommended to improve reproducibility
17+ , useLastCommit ? true } : rec {
18+
19+ faraday-server = python3 . pkgs . faradaysec . overrideAttrs ( old :
20+ {
21+ doCheck = true ;
22+ checkPhase = "true" ;
23+ checkInputs = with python3 . pkgs ; [
24+ pylint
25+ factory_boy
26+ pytest
27+ pytest-factoryboy
28+ responses
29+ hypothesis
30+ sphinx
31+ pytestcov
32+ ] ;
33+ } // lib . optionalAttrs useLastCommit { src = builtins . fetchGit ./. ; } ) ;
34+
735 dockerImage = dockerTools . buildImage {
8- name = "registry.gitlab.com/faradaysec/faraday" ;
9- tag = version ;
36+ name = dockerName ;
37+ tag = dockerTag ;
1038 created = "now" ;
1139 fromImage = null ;
1240 contents = [ python3 . pkgs . faradaysec bash gnused coreutils ] ;
@@ -27,7 +55,10 @@ in { dockerName ? "registry.gitlab.com/faradaysec/faraday", dockerTag ? version
2755 } . # Not required, but useful for debug
2856 cp ${ coreutils } /bin/env usr/bin/env
2957 ln -s ${ python3 . pkgs . faradaysec } opt/faraday
30- ln -s /home/faraday/.faraday/doc faraday-license # Not useful in Community version
58+ ${
59+ lib . optionalString ( product != "community" )
60+ "ln -s /home/faraday/.faraday/doc faraday-license"
61+ }
3162 ln -s /home/faraday/.faraday/storage faraday-storage
3263 ln -s /home/faraday/.faraday/config faraday-config
3364 '' ;
0 commit comments