51 lines
1.3 KiB
Nix
51 lines
1.3 KiB
Nix
{
|
|
description = "Downloader Nix Flake";
|
|
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
|
|
|
|
outputs =
|
|
{ self, nixpkgs }:
|
|
let
|
|
supportedSystems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
forEachSupportedSystem =
|
|
f:
|
|
nixpkgs.lib.genAttrs supportedSystems (
|
|
system:
|
|
f {
|
|
pkgs = import nixpkgs { inherit system; };
|
|
lib = nixpkgs.lib;
|
|
}
|
|
);
|
|
in
|
|
{
|
|
devShells = forEachSupportedSystem (
|
|
{ pkgs, lib }:
|
|
let
|
|
myPython = pkgs.python313;
|
|
in
|
|
{
|
|
default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
myPython
|
|
uv
|
|
ruff # the ruff pip package installs a dynamically linked binary that cannot run on NixOS
|
|
forgejo-runner
|
|
];
|
|
shellHook = # bash
|
|
''
|
|
export "UV_PYTHON_PREFERENCE=only-system"
|
|
export "UV_PYTHON_DOWNLOADS=never"
|
|
uv sync --all-groups
|
|
source ./.venv/bin/activate
|
|
export "PYTHONPATH=`pwd`/.venv/${myPython.sitePackages}/:$PYTHONPATH"
|
|
export "PATH=${pkgs.ruff}/bin:$PATH"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|