-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
53 lines (48 loc) · 1.77 KB
/
flake.nix
File metadata and controls
53 lines (48 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
description = "Python tool to run a given REPL session and evaluate the outcomes";
inputs.pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{ nixpkgs, pyproject-nix, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
project = pyproject-nix.lib.project.loadPyproject {
projectRoot = ./.;
};
pythonAttr = "python3";
overlay = final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [
(python-final: python-prev: {
argh = python-prev.argh.overridePythonAttrs(old: rec {
version = "0.30.5";
src = python-final.fetchPypi {
pname = "argh";
inherit version;
sha256 = "sha256-s339YXoJ0ZpKe8rtDgYLKIvHrI39wPrPiGpJol/zNyg=";
};
doCheck = false;
});
msgspec = python-prev.msgspec.overridePythonAttrs(old: rec {
version = "0.20.0";
src = final.fetchFromGitHub {
owner = "jcrist";
repo = "msgspec";
tag = "${version}";
sha256 = "sha256-DWDmnSuo12oXl9NVfNhIOtWrQeJ9DMmHxOyHY33Datk=";
};
build-system = [ python-final.setuptools-scm ];
});
})
];
};
in
let
pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
python = pkgs.${pythonAttr};
pythonEnv = python.withPackages (project.renderers.withPackages { inherit python; });
in
{
devShells.default = pkgs.mkShell { packages = [ pythonEnv ]; };
packages.default = python.pkgs.buildPythonPackage (project.renderers.buildPythonPackage { inherit python; });
});
}