Downloader/flake.nix
cswimr 9c883dbbe3
Some checks failed
Actions / Lint (push) Failing after 0s
Actions / Build and Push Images (push) Failing after 10s
chore(tooling): improve flake
2025-02-13 11:12:35 -06:00

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"
'';
};
}
);
};
}