-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
50 lines (47 loc) · 1.42 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
{
description = "cosmo - ???";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
outputs = { self, nixpkgs, flake-utils }:
{
overlay = (final: prev: let
pyprojectFile = builtins.fromTOML (builtins.readFile ./pyproject.toml);
# We absolutly want to ship our own deps, so we use our own python and our own python3Packages.
pkgs = import nixpkgs {
inherit (final) system;
};
in {
cosmo = final.callPackage ./package.nix { python3 = pkgs.python3; python3Packages = pkgs.python3.pkgs; version = pyprojectFile.tool.poetry.version; };
});
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in
{
packages = {
cosmo = pkgs.cosmo;
default = pkgs.cosmo;
};
devShell = pkgs.mkShell {
buildInputs = [
(pkgs.python3.withPackages (python-pkgs: with python-pkgs; [
requests
pyyaml
packaging
deepmerge
termcolor
# Dev Dependencies
mypy
pytest
pytest-cov
pytest-mock
types-pyyaml
types-requests
]))
];
};
}));
}