chore(tooling): fix the nix flake
Some checks failed
Actions / Build Documentation (MkDocs) (push) Failing after 26s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 47s

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

10
flake.lock generated
View file

@ -2,12 +2,12 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1738546358,
"narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=",
"rev": "c6e957d81b96751a3d5967a0fd73694f303cc914",
"revCount": 747070,
"lastModified": 1738680400,
"narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"rev": "799ba5bffed04ced7067a91798353d360788b30d",
"revCount": 747653,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.747070%2Brev-c6e957d81b96751a3d5967a0fd73694f303cc914/0194cfda-968b-7c4f-95c5-bd4a42478770/source.tar.gz"
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.747653%2Brev-799ba5bffed04ced7067a91798353d360788b30d/0194d302-29da-7009-8f43-5b8a58825954/source.tar.gz"
},
"original": {
"type": "tarball",

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