Skip to content

Commit

Permalink
Update nix files
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Sep 1, 2024
1 parent a956d49 commit c771471
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
6 changes: 3 additions & 3 deletions dev_tools/py_requirements.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ with pypkgs;
pytest
# needed by tests
arrow
faker
# faker
psutil
pytest-random-order
pytest-xdist
pytz
# add packages here
(pypkgs.buildPythonPackage rec {
(lib.mkIf (pypkgs.python.sourceVersion.minor < 12) (pypkgs.buildPythonPackage rec {
pname = "orjson";
version = "3.10.6";
pyproject = true;
Expand Down Expand Up @@ -89,7 +89,7 @@ with pypkgs;
ufolib2
;
};
})
}))
] ++
(with pypkgs;
[
Expand Down
12 changes: 7 additions & 5 deletions dev_tools/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ pkgs.mkShell {
# unzip the source
mkdir -p debug_source
cd debug_source
if [[ ! -d ${using_python.src} ]]; then
tar xvf ${using_python.src} &> /dev/null
if [[ ! -d Python-${using_python.version} ]]; then
tar xvf ${using_python.src}
chmod -R 700 Python-${using_python.version}
fi
if [[ ! -d orjson ]]; then
# this is a directory, not a tarball
cp -r ${pkgs.python312Packages.orjson.src} orjson
echo "orjson source copied"
# this is a directory, not a tarball
cp -r ${pkgs.python312Packages.orjson.src} orjson
chmod -R 700 orjson
echo "orjson source copied"
fi
cd ..
# python lib
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
description = "pyyjson flake";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs }: let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
packages.${system}.default = import ./dev_tools/shell.nix {
inherit pkgs;
};
};
}

0 comments on commit c771471

Please sign in to comment.