Files
yt-dlp-bot/flake.nix
William P b496d14cf7
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 23s
Build and Push Docker Image / deploy-on-green (push) Successful in 9s
flake: add go and yt-dlp for refactor
2026-01-26 20:34:04 -05:00

52 lines
1.6 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
pkgs.deno
pkgs.go
pkgs.yt-dlp
];
shellHook = ''
if [ -f .env ]; then
set -a
source .env
set +a
fi
if [ ! -d .venv ]; then
echo "Creating Python virtual environment in .venv"
python3 -m venv .venv
fi
if compgen -G "app/*.py" > /dev/null; then
.venv/bin/pip install -r ./app/requirements.txt
source .venv/bin/activate
fi
'';
};
});
};
}