2022-10-03 15:47:31 +02:00
|
|
|
{ pkgs ? (import <nixpkgs>) { }, lib ? pkgs.lib }:
|
2022-10-03 13:08:01 +02:00
|
|
|
|
2022-10-03 10:34:06 +02:00
|
|
|
let
|
2022-10-03 15:47:31 +02:00
|
|
|
mkRequirements = file:
|
|
|
|
builtins.concatStringsSep "\n"
|
|
|
|
(builtins.filter
|
|
|
|
(s: !(lib.hasPrefix "-r" s || lib.hasPrefix "#" s || s == ""))
|
|
|
|
(lib.splitString "\n" (builtins.readFile file)));
|
|
|
|
|
2022-10-03 13:08:01 +02:00
|
|
|
pypiDataRev = "2505eb53d85cd727c87611ee4aa35152821a12b2";
|
|
|
|
pypiDataSha256 = "0nhl0rzlp4fgzxb15pmnq14d0rzcwhvwn40vx7fnk41z9gwxcp4c";
|
|
|
|
|
|
|
|
pypiData = builtins.fetchTarball {
|
|
|
|
name = "pypi-deps-db-src";
|
|
|
|
url = "https://github.com/DavHau/pypi-deps-db/tarball/${pypiDataRev}";
|
|
|
|
sha256 = "${pypiDataSha256}";
|
|
|
|
};
|
|
|
|
|
2022-10-03 10:34:06 +02:00
|
|
|
mach-nix = import
|
|
|
|
(builtins.fetchGit {
|
|
|
|
url = "https://github.com/DavHau/mach-nix";
|
|
|
|
ref = "refs/tags/3.5.0";
|
|
|
|
})
|
2022-10-03 13:08:01 +02:00
|
|
|
{
|
|
|
|
inherit pypiData;
|
|
|
|
|
|
|
|
python = "python39";
|
|
|
|
};
|
2022-10-03 10:34:06 +02:00
|
|
|
|
2022-10-03 15:47:31 +02:00
|
|
|
requirements = mkRequirements ./requirements.txt;
|
2022-10-03 10:34:06 +02:00
|
|
|
|
2022-10-03 15:47:31 +02:00
|
|
|
requirements-prod = mkRequirements ./requirements-prod.txt;
|
2022-10-03 13:19:52 +02:00
|
|
|
|
2022-10-03 15:47:31 +02:00
|
|
|
requirements-dev = mkRequirements ./requirements-devel.txt;
|
|
|
|
|
|
|
|
pyEnv = mach-nix.mkPython {
|
|
|
|
requirements = builtins.concatStringsSep "\n" [
|
|
|
|
requirements
|
|
|
|
requirements-dev
|
|
|
|
requirements-prod
|
|
|
|
];
|
|
|
|
};
|
2022-10-03 10:34:06 +02:00
|
|
|
in
|
|
|
|
|
2022-10-03 13:19:52 +02:00
|
|
|
pkgs.mkShell {
|
|
|
|
buildInputs = [ pyEnv ];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
export DJANGO_SETTINGS_MODULE=gestioasso.settings.local
|
|
|
|
'';
|
2022-10-03 10:34:06 +02:00
|
|
|
}
|