diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c84fb21 --- /dev/null +++ b/flake.lock @@ -0,0 +1,110 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1601282935, + "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "588973065fce51f4763287f0fda87a174d78bf48", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "mach-nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "pypi-deps-db": "pypi-deps-db" + }, + "locked": { + "lastModified": 1637687243, + "narHash": "sha256-Qm0hPR9ZT1EP7lRW4udAPeb4yv6D2ONcw9ayterTP18=", + "owner": "DavHau", + "repo": "mach-nix", + "rev": "31b21203a1350bff7c541e9dfdd4e07f76d874be", + "type": "github" + }, + "original": { + "owner": "DavHau", + "repo": "mach-nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1622797669, + "narHash": "sha256-xIyWeoYExzF0KNaKcqfxEX58fN4JTIQxTJWbsAujllc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1ca6b0a0cc38dbba0441202535c92841dd39d1ae", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1638587357, + "narHash": "sha256-2ySMW3QARG8BsRPmwe7clTbdCuaObromOKewykP+UJc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e34c5379866833f41e2a36f309912fa675d687c7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "pypi-deps-db": { + "flake": false, + "locked": { + "lastModified": 1622970040, + "narHash": "sha256-u//RFnae/XMIhoy83G2uH2Qu/1LiUhVCdwwY1xj4Ufs=", + "owner": "DavHau", + "repo": "pypi-deps-db", + "rev": "be6591698c67a86a69c81fef72167e38d038a9fc", + "type": "github" + }, + "original": { + "owner": "DavHau", + "repo": "pypi-deps-db", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "mach-nix": "mach-nix", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2ba9a37 --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "A Python API for various tools I use at work."; + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11; + flake-utils.url = github:numtide/flake-utils; + mach-nix.url = "github:DavHau/mach-nix"; + }; + + outputs = { self, nixpkgs, flake-utils, mach-nix }: + with flake-utils.lib; eachSystem allSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + base-requirements = builtins.readFile ./requirements/base.txt; + pyEnv = mach-nix.lib."${system}".mkPython { + requirements = base-requirements; + }; + in + rec { + devShell = mach-nix.lib."${system}".mkPythonShell { + requirements = base-requirements + '' + flake8 + autopep8 + pytest + pytest-cov + pyinstaller + ''; + }; + }); +}