chore(tooling): fix the nix flake

This commit is contained in:
cswimr 2025-02-06 17:20:39 -06:00
parent e7714cd2df
commit 527c372fb0
Signed by untrusted user: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 30 additions and 16 deletions

View file

@ -17,39 +17,53 @@
system:
f {
pkgs = import nixpkgs { inherit system; };
lib = nixpkgs.lib;
}
);
in
{
devShells = forEachSupportedSystem (
{ pkgs }:
{ pkgs, lib }:
let
myPython = pkgs.python311;
lib-path =
with pkgs;
lib.makeLibraryPath [
stdenv.cc.cc
# Red-DiscordBot dependencies
libffi
libsodium
# PyLav dependency
libaio
# Material for MkDocs dependency
cairo
];
in
{
default = pkgs.mkShell {
lib-path = lib-path;
packages = with pkgs; [
python311
myPython
uv
ruff # the ruff pip package installs a dynamically linked binary that cannot run on NixOS
forgejo-runner
# Red-DiscordBot dependencies
git
libsodium
libffi
jdk17
# Material for MkDocs dependencies
cairo
pngquant
# PyLav dependencies
libaio
# SeaCogs dependencies
dig
];
shellHook = # bash
''
export UV_PYTHON_PREFERENCE=only-system
export UV_PYTHON_DOWNLOADS=never
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
export "UV_PYTHON_PREFERENCE=only-system"
export "UV_PYTHON_DOWNLOADS=never"
uv sync --all-groups
alias uvr="uv run"
source ./.venv/bin/activate
export PYTHONPATH=`pwd`/.venv/${pkgs.python311.sitePackages}/:$PYTHONPATH
export "PYTHONPATH=`pwd`/.venv/${myPython.sitePackages}/:$PYTHONPATH"
export "PATH=${pkgs.ruff}/bin:$PATH"
'';
};
}