Skip to content

Commit 7ea3170

Browse files
authored
Merge pull request #1 from v1kko/main
Added nix flake to repl-session
2 parents d106b30 + a39e8f0 commit 7ea3170

2 files changed

Lines changed: 99 additions & 0 deletions

File tree

flake.lock

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

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

0 commit comments

Comments
 (0)