From 5902116fa61da79c601d2b58059b5941b674cf4c Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Sun, 5 Nov 2023 11:17:15 -0600 Subject: [PATCH] feat: initial commit --- .envrc | 1 + .gitignore | 4 ++++ flake.lock | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 120 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..8dfc6aa --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +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..6960887 --- /dev/null +++ b/flake.nix @@ -0,0 +1,59 @@ +{ + 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; + + src = pkgs.fetchFromGitHub { + owner = "webcomics"; + repo = "dosage"; + rev = "9163317abadcef0a562afaaf422828b56d006e20"; + hash = "sha256-t5HxvXCFPNG5K1uDtfIxDo6JV921ywY1Eznj7GoSh44="; + }; + in rec { + defaultPackage = python3Packages.buildPythonApplication rec { + pname = "dosage"; + version = "3.1.dev104+g9e05fae304"; + format = "pyproject"; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + pytest-xdist + responses + ]; + + requirements = "${src}/setup/requirements.txt"; + + 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; + }); +}