fix the flake
This commit is contained in:
parent
af6a6292af
commit
33cc7cd058
35
flake.nix
35
flake.nix
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue