72 lines
2 KiB
Nix
72 lines
2 KiB
Nix
{
|
|
description = "SeaCogs 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.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; [
|
|
myPython
|
|
uv
|
|
ruff # the ruff pip package installs a dynamically linked binary that cannot run on NixOS
|
|
forgejo-runner
|
|
# Red-DiscordBot dependencies
|
|
git
|
|
jdk17
|
|
# Material for MkDocs dependencies
|
|
pngquant
|
|
# SeaCogs dependencies
|
|
dig
|
|
];
|
|
shellHook = # bash
|
|
''
|
|
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
|
|
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"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|