Files
mt/Deep-SAD-PyTorch/flake.nix

50 lines
1.3 KiB
Nix
Raw Normal View History

{
description = "Deepsad devenv with python 3.11";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
pkgs = import nixpkgs{
inherit system;
config.allowUnfree = true;
config.cudaSupport = true;
};
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
in
{
packages = {
deepsad = mkPoetryApplication {
projectDir = self;
preferWheels = true;
python = pkgs.python311;
};
default = self.packages.${system}.deepsad;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.deepsad ];
buildInputs = with pkgs.python311Packages; [
torch-bin
torchvision-bin
];
#LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
#pkgs.stdenv.cc.cc
#];
};
devShells.poetry = pkgs.mkShell {
packages = [ pkgs.poetry pkgs.python311 ];
};
});
}