init
This commit is contained in:
commit
e42a8a9185
15 changed files with 1944 additions and 0 deletions
81
flake.nix
Normal file
81
flake.nix
Normal file
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
description = "forgesync";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
pyproject-nix = {
|
||||
url = "github:pyproject-nix/pyproject.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
uv2nix = {
|
||||
url = "github:pyproject-nix/uv2nix";
|
||||
inputs.pyproject-nix.follows = "pyproject-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
pyproject-build-systems = {
|
||||
url = "github:pyproject-nix/build-system-pkgs";
|
||||
inputs.pyproject-nix.follows = "pyproject-nix";
|
||||
inputs.uv2nix.follows = "uv2nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-parts,
|
||||
uv2nix,
|
||||
pyproject-nix,
|
||||
pyproject-build-systems,
|
||||
...
|
||||
} @ inputs: let
|
||||
workspace = uv2nix.lib.workspace.loadWorkspace {workspaceRoot = ./.;};
|
||||
overlay = workspace.mkPyprojectOverlay {
|
||||
sourcePreference = "wheel";
|
||||
};
|
||||
in
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux" "aarch64-linux"];
|
||||
|
||||
perSystem = {
|
||||
pkgs,
|
||||
inputs',
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
python = pkgs.python313;
|
||||
pythonSet =
|
||||
(pkgs.callPackage pyproject-nix.build.packages {
|
||||
inherit python;
|
||||
}).overrideScope
|
||||
(
|
||||
lib.composeManyExtensions [
|
||||
pyproject-build-systems.overlays.default
|
||||
overlay
|
||||
]
|
||||
);
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
python
|
||||
pkgs.libffi
|
||||
pkgs.uv
|
||||
];
|
||||
env =
|
||||
{
|
||||
UV_PYTHON_DOWNLOADS = "never";
|
||||
UV_PYTHON = python.interpreter;
|
||||
}
|
||||
// lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||
LD_LIBRARY_PATH = lib.makeLibraryPath pkgs.pythonManylinuxPackages.manylinux1;
|
||||
};
|
||||
shellHook = ''
|
||||
unset PYTHONPATH
|
||||
'';
|
||||
};
|
||||
|
||||
packages.default = pythonSet.mkVirtualEnv "forgesync" workspace.deps.default;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue