Files
yt-dlp-bot/flake.nix
2025-07-11 20:22:56 -04:00

40 lines
1.2 KiB
Nix

{
description = "Dev Environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let
lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
version = builtins.substring 0 8 lastModifiedDate;
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor.${system};
in
{
default = pkgs.mkShell {
buildInputs = [
pkgs.bashInteractive
pkgs.python314
pkgs.virtualenv
pkgs.ffmpeg_6
];
shellHook = ''
if [ ! -d .venv ]; then
echo "Creating Python virtual environment in .venv"
python3 -m venv .venv
fi
.venv/bin/pip install -r ./app/requirements.txt
source .venv/bin/activate
'';
};
});
};
}