-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
39 lines (35 loc) · 1.01 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
description = "Nix Flake Template for Python using Poetry";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
poetry2nix.url = "github:nix-community/poetry2nix";
};
outputs = {
self,
nixpkgs,
poetry2nix,
}: let
systems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgs = forEachSystem (system: import nixpkgs {inherit system;});
in {
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.alejandra);
devShells = forEachSystem (system: {
default = pkgs.${system}.mkShell {
packages = with pkgs.${system}; [
python3
poetry
];
};
});
apps = forEachSystem (system: let
inherit (poetry2nix.lib.mkPoetry2Nix {pkgs = pkgs.${system};}) mkPoetryApplication;
app = mkPoetryApplication {projectDir = ./.;};
in {
default = {
type = "app";
program = "${app}/bin/app";
};
});
};
}