mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-07 21:40:58 +00:00
Cleanup error handling
This commit is contained in:
@@ -1,28 +1,27 @@
|
||||
{pkgs ? import <nixpkgs> {}}:
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nodejs-16_x
|
||||
nodePackages.yarn
|
||||
(with dotnetCorePackages;
|
||||
combinePackages [
|
||||
sdk_6_0
|
||||
aspnetcore_6_0
|
||||
])
|
||||
python3
|
||||
python3Packages.venvShellHook
|
||||
];
|
||||
|
||||
# Run this command, only after creating the virtual environment
|
||||
{pkgs ? import <nixpkgs> {}}: let
|
||||
venvDir = "./.venv";
|
||||
postVenvCreation = ''
|
||||
unset SOURCE_DATE_EPOCH
|
||||
pip install -r ./scanner/requirements.txt
|
||||
'';
|
||||
pythonPkgs = ./scanner/requirements.txt;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
nodejs-16_x
|
||||
nodePackages.yarn
|
||||
(with dotnetCorePackages;
|
||||
combinePackages [
|
||||
sdk_6_0
|
||||
aspnetcore_6_0
|
||||
])
|
||||
python3
|
||||
];
|
||||
|
||||
# Now we can execute any commands within the virtual environment.
|
||||
# This is optional and can be left out to run pip manually.
|
||||
postShellHook = ''
|
||||
# allow pip to install wheels
|
||||
unset SOURCE_DATE_EPOCH
|
||||
'';
|
||||
}
|
||||
shellHook = ''
|
||||
# Install python modules
|
||||
SOURCE_DATE_EPOCH=$(date +%s)
|
||||
if [ ! -d "${venvDir}" ]; then
|
||||
${pkgs.python3} -m venv "${venvDir}"
|
||||
fi
|
||||
source "${venvDir}/bin/activate"
|
||||
export PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
pip install -r ${pythonPkgs}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user