From 99d82d207c4c09e137017c2a2c6138065b4fe426 Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Sun, 27 Aug 2023 08:06:25 -0500 Subject: [PATCH] chore: initial commit --- .envrc | 2 ++ .gitignore | 4 ++++ flake.lock | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix 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..8a19632 --- /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-M4VFpy7Av9j+33HF5nIGm0k2+DXXW4qSSKdidIKg5jY=", + "rev": "74e5bdc5478ebbe7ba5849f0d765f92757bb9dbf", + "revCount": 490387, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2305.490387%2Brev-74e5bdc5478ebbe7ba5849f0d765f92757bb9dbf/018a32e8-728e-79be-b750-1e9bf72e5a50/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/%2A.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..788fead --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ + description = "A comic strip downloader and archiver"; + + inputs = { + nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.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.0"; + format = "pyproject"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-mHV/U9Vqv7fSsLYNrCXckkJ1YpsccLd8HsJ78IwLX0Y="; + }; + + 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; + }); +}