37 lines
1.2 KiB
Nix
37 lines
1.2 KiB
Nix
|
{
|
||
|
description = "{{ cookiecutter.project_short_description }}";
|
||
|
|
||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||
|
inputs.poetry2nix = {
|
||
|
url = "github:nix-community/poetry2nix";
|
||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||
|
};
|
||
|
|
||
|
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
||
|
flake-utils.lib.eachDefaultSystem (system:
|
||
|
let
|
||
|
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
|
||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||
|
in
|
||
|
{
|
||
|
packages = {
|
||
|
{{ cookiecutter.project_slug }} = mkPoetryApplication { projectDir = self; };
|
||
|
docker = pkgs.dockerTools.buildImage {
|
||
|
name = "{{ cookiecutter.project_slug }}";
|
||
|
tag = "latest";
|
||
|
copyToRoot = pkgs.buildEnv {
|
||
|
name = "{{ cookiecutter.project_slug }}_root_img";
|
||
|
paths = [ self.packages.${system}.{{ cookiecutter.project_slug }} ];
|
||
|
pathsToLink = [ "/bin" ];
|
||
|
};
|
||
|
};
|
||
|
default = self.packages.${system}.{{ cookiecutter.project_slug }};
|
||
|
};
|
||
|
|
||
|
devShells.default = pkgs.mkShell {
|
||
|
packages = [ poetry2nix.packages.${system}.poetry ];
|
||
|
};
|
||
|
});
|
||
|
}
|