grok-1/flake.nix
2024-03-23 12:26:52 +02:00

49 lines
1.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
python = pkgs.python311;
in
{
devShells.default = pkgs.mkShell {
# build-time
nativeBuildInputs = with pkgs; [
bashInteractive
];
# run-time
buildInputs = (with pkgs; [
transmission
just
]) ++ (with python.pkgs; [
setuptools
wheel
venvShellHook
pkgs.ruff
]);
# python setup
src = null;
venvDir = ".venv";
postVenv = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
unset LD_PRELOAD
PYTHONPATH=$PWD/$venvDir/${python.sitePackages}:$PYTHONPATH
pip install --require-virtualenv -r requirements.txt | grep -v 'already satisfied'
git config --local core.hooksPath .github/hooks
'';
};
}
);
}