commit 858dee7d60e60bdbafef3067f8e79012a2d71f45 Author: D. Moonfire Date: Sun Aug 27 09:05:35 2023 -0500 chore: initial commit diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..a988035 --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +nix_direnv_watch_file requirements.txt +use flake || use nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cdd18cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.env + +/.direnv +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..104a8e4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,56 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=", + "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44", + "revCount": 85, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/numtide/flake-utils/0.1.85%2Brev-f9e7cf818399d17d347f847525c5a5a8032e4e44/018a2375-3956-7f5c-9bbc-bd668014303a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/numtide/flake-utils/0.1.85.tar.gz" + } + }, + "nixpkgs": { + "locked": { + "narHash": "sha256-5nm4yrEHKupjn62MibENtfqlP6pWcRTuSKrMiH9bLkc=", + "rev": "5690c4271f2998c304a45c91a0aeb8fb69feaea7", + "revCount": 518598, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.518598%2Brev-5690c4271f2998c304a45c91a0aeb8fb69feaea7/018a32e8-6e96-7b90-bccc-a5cf4c5ac2dd/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..5626d3d --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + description = "A comic strip downloader and archiver (unstable)"; + + inputs = { + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz"; + flake-utils.url = + "https://flakehub.com/f/numtide/flake-utils/0.1.85.tar.gz"; + }; + + outputs = { self, nixpkgs, flake-utils, ... }: + let pythonVersion = "python39"; + in flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + lib = pkgs.lib; + python3Packages = pkgs.python3Packages; + fetchPypi = pkgs.fetchPypi; + in rec { + defaultPackage = python3Packages.buildPythonApplication rec { + pname = "dosage"; + version = "3.1.dev104+g9e05fae304"; + format = "pyproject"; + + src = pkgs.fetchFromGitHub { + owner = "webcomics"; + repo = "dosage"; + rev = "9e05fae3041f0b20260d253b9964aed53fb3932e"; + hash = "sha256-91lVAc6Mkeot3T12MAl7v9v4huMWD+0O18b3Hjd4Bkw="; + }; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + pytest-xdist + responses + ]; + + nativeBuildInputs = with python3Packages; [ setuptools-scm ]; + + propagatedBuildInputs = with python3Packages; [ + colorama + imagesize + lxml + platformdirs + requests + ]; + + meta = { + description = "A comic strip downloader and archiver"; + homepage = "https://dosage.rocks/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dmoonfire ]; + }; + }; + + formatter = pkgs.alejandra; + }); +}