Downloader/flake.nix

52 lines
1.3 KiB
Nix
Raw Normal View History

2024-12-28 10:40:12 -05:00
{
2025-02-13 11:12:35 -06:00
description = "Downloader Nix Flake";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
2024-12-28 10:40:12 -05:00
2025-02-13 11:12:35 -06:00
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"
'';
2024-12-28 10:40:12 -05:00
};
2025-02-13 11:12:35 -06:00
}
);
2024-12-28 10:40:12 -05:00
};
}