39
flake.nix
Normal file
39
flake.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{
|
||||
description = "Application packaged using poetry2nix";
|
||||
|
||||
inputs = {
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
||||
poetry2nix = {
|
||||
url = "github:nix-community/poetry2nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs = {
|
||||
nixpkgs.follows = "nixpkgs";
|
||||
# nixpkgs-stable.follows = "nixpkgs-stable";
|
||||
# flake-compat.follows = "flake-compat";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils, poetry2nix,pre-commit-hooks }@inputs:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
|
||||
in
|
||||
rec {
|
||||
packages = {
|
||||
myapp = mkPoetryApplication { projectDir = self; };
|
||||
default = self.packages.${system}.myapp;
|
||||
};
|
||||
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
|
||||
devShells = import ./shell.nix {inherit self inputs system checks;};
|
||||
checks = import ./checks.nix {inherit inputs system formatter;};
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user