fix the flake

This commit is contained in:
Andreas Zweili 2021-12-06 20:26:59 +01:00
parent af6a6292af
commit 33cc7cd058
1 changed files with 29 additions and 6 deletions

View File

@ -12,18 +12,41 @@
pkgs = nixpkgs.legacyPackages.${system};
base-requirements = builtins.readFile ./requirements/base.txt;
pyEnv = mach-nix.lib."${system}".mkPython {
requirements = base-requirements;
};
in
rec {
devShell = mach-nix.lib."${system}".mkPythonShell {
requirements = base-requirements + ''
flake8
autopep8
flake8
pytest
pytest-cov
pyinstaller
'';
};
in
rec {
devShell."${system}" = pkgs.mkShell {
buildInputs = [ pyEnv ];
};
packages = {
binary = pkgs.stdenv.mkDerivation rec {
name = "todoist_interface";
src = self;
buildInputs = [
pkgs.coreutils
pkgs.glibc
pkgs.bintools-unwrapped
pyEnv
];
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
export PATH="${pkgs.lib.makeBinPath buildInputs}";
python -m pytest tests
pyinstaller -F todoist_interface/__main__.py -n todoist_interface
'';
installPhase = ''
mkdir -p $out
cp /build/source/dist/todoist_interface "$out/todoist_interface"
'';
};
};
defaultPackage = packages.binary;
});
}