feat: create flake.nix for nix-based development

This commit is contained in:
Khaïs COLIN 2024-08-26 19:12:14 +02:00
parent 04481d62b5
commit fc58983915
4 changed files with 151 additions and 0 deletions

34
flake.nix Normal file
View file

@ -0,0 +1,34 @@
{
description = "Command line utility for generating ASN labels for paperless with both a human-readable representation, as well as a QR code for machine consumption.";
inputs = {
pyproject-nix = {
url = "github:nix-community/pyproject.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, pyproject-nix, ... }:
let
project = pyproject-nix.lib.project.loadPyproject {
projectRoot = ./.;
};
pkgs = nixpkgs.legacyPackages.x86_64-linux;
python = pkgs.python3;
in
{
devShells.x86_64-linux.default =
let
arg = project.renderers.withPackages { inherit python; };
pythonEnv = python.withPackages arg;
in
pkgs.mkShell { packages = [ pythonEnv ]; };
packages.x86_64-linux.default =
let
attrs = project.renderers.buildPythonPackage { inherit python; };
in
python.pkgs.buildPythonPackage attrs;
};
}