initial commit
This commit is contained in:
parent
6f2260e7f5
commit
1f3eb16391
4 changed files with 154 additions and 0 deletions
41
flake.nix
Normal file
41
flake.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
description = "Flake using pyproject.toml metadata";
|
||||
|
||||
inputs.pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
|
||||
inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
outputs =
|
||||
{ nixpkgs, pyproject-nix, ... }:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
|
||||
|
||||
project = pyproject-nix.lib.project.loadPyproject {
|
||||
projectRoot = ./.;
|
||||
};
|
||||
|
||||
pythonAttr = "python3";
|
||||
in
|
||||
{
|
||||
devShells = forAllSystems (system: {
|
||||
default =
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
python = pkgs.${pythonAttr};
|
||||
pythonEnv = python.withPackages (project.renderers.withPackages { inherit python; });
|
||||
in
|
||||
pkgs.mkShell { packages = [ pythonEnv ]; };
|
||||
});
|
||||
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
python = pkgs.${pythonAttr};
|
||||
in
|
||||
{
|
||||
default = python.pkgs.buildPythonPackage (project.renderers.buildPythonPackage { inherit python; });
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue