Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nix): add flake #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
lib,
python3,
audiobook-dl-src,
}:

python3.pkgs.buildPythonApplication rec {
pname = "audiobook-dl";
version = "unstable-2024-10-24";
pyproject = true;

src = audiobook-dl-src;

build-system = [
python3.pkgs.setuptools
python3.pkgs.setuptools-scm
];

dependencies = with python3.pkgs; [
appdirs
attrs
cssselect
importlib-resources
lxml
m3u8
mutagen
pillow
pycountry
pycryptodome
requests
rich
tomli
urllib3
];

meta = {
description = "Audiobook CLI downloader";
homepage = "https://github.com/jo1gi/audiobook-dl";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ];
mainProgram = "audiobook-dl";
};
}
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
description = "audiobook-dl flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.audiobook-dl = pkgs.callPackage ./default.nix { audiobook-dl-src = ./.; };
packages.default = self.packages.${system}.audiobook-dl;
devShells.default = pkgs.mkShell {
packages = with pkgs; [
ffmpeg
(python312.withPackages (
ps: with ps; [
mutagen
requests
rich
lxml
cssselect
pillow
m3u8
pycryptodome
importlib-resources
appdirs
tomli
attrs
pycountry
urllib3

# Test
pytest
mypy
types-requests
types-setuptools

# Build
build
setuptools
twine
]
))
];
};
}
);
}