-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
52 lines (48 loc) · 1.25 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
40
41
42
43
44
45
46
47
48
49
50
51
52
{
description = "Flake for optimal-congress";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
poetry2nix,
}:
let
lib = nixpkgs.lib;
forAllSystems = lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
poetryConfig = {
projectDir = ./.;
# when compiling locally, this flake does not work because transitive rust dependencies are not version pinned
preferWheels = true;
};
in
{
apps = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages."${system}";
inherit (poetry2nix.lib.mkPoetry2Nix { inherit pkgs; }) mkPoetryApplication;
myPythonApp = mkPoetryApplication poetryConfig;
in
rec {
optimal-congress = {
type = "app";
program = "${myPythonApp}/bin/optimal-congress";
};
default = optimal-congress;
}
);
formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixfmt-rfc-style);
};
}