protestswap/flake.nix

42 lines
1.1 KiB
Nix
Raw Normal View History

2025-10-13 17:32:48 +02:00
{
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; });
}
);
};
}