Add default.nix, allow for nix run.

This commit is contained in:
CronyAkatsuki 2024-03-07 21:18:14 +01:00
parent 3e3687b700
commit 06dcf34160
5 changed files with 25 additions and 0 deletions

12
default.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs.python3Packages;
buildPythonPackage rec {
name = "hb-downloader";
src = ./.;
propagatedBuildInputs = [ requests pkgs.aria2 ];
meta.mainProgram = "hb-downloader";
postInstall = ''
mv -v $out/bin/hb-downloader.py $out/bin/hb-downloader
'';
}

View File

@ -11,5 +11,6 @@
in
{
devShells.x86_64-linux.default = ( import ./shell.nix { inherit pkgs; });
packages.x86_64-linux.default = ( import ./default.nix { inherit pkgs; });
};
}

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
requests

11
setup.py Normal file
View File

@ -0,0 +1,11 @@
from setuptools import setup
with open('requirements.txt') as f:
install_requires = f.read().splitlines()
setup(
name = 'hb-downloader',
version = '0.1',
install_requires=install_requires,
scripts=['hb-downloader.py',],
)