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": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1738546358, "lastModified": 1738680400,
"narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=", "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=",
"rev": "c6e957d81b96751a3d5967a0fd73694f303cc914", "rev": "799ba5bffed04ced7067a91798353d360788b30d",
"revCount": 747070, "revCount": 747653,
"type": "tarball", "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": { "original": {
"type": "tarball", "type": "tarball",

View file

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