-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
78 lines (68 loc) · 2.22 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
epnix.url = "github:epics-extensions/EPNix";
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
};
outputs = {
self,
nixpkgs,
flake-utils,
epnix,
flake-compat,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
epnix.overlays.default
(_final: _prev: {
wetest = self.packages.${system}.default;
})
];
};
in {
packages.default = let
# Numpy 1.19.5 doesn't compile with Python3.10+
#
# This was fixed in later versions of Numpy, but Numpy >=1.20 doesn't
# support Python 3.6, which we need to support older systems.
python = pkgs.python39;
in
pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
inherit python;
nativeBuildInputs = with pkgs; [makeWrapper];
propagatedBuildInputs = with python.pkgs; [tkinter];
overrides = pkgs.poetry2nix.overrides.withDefaults (_final: prev: {
reportlab = prev.reportlab.overridePythonAttrs (_old: {
buildInputs = with pkgs; [(freetype.overrideAttrs (_: {dontDisableStatic = true;}))];
});
});
postInstall = let
inherit (epnix.packages.x86_64-linux) epics-base;
in ''
wrapProgram $out/bin/wetest \
--set PYEPICS_LIBCA "${epics-base}/lib/linux-x86_64/libca.so"
'';
doCheck = true;
checkPhase = ''
runHook preCheck
pytest
runHook postCheck
'';
meta = {
description = "Tests automation utility for EPICS";
mainProgram = "wetest";
license = epnix.lib.licenses.epics;
maintainers = with epnix.lib.maintainers; [minijackson];
};
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [poetry python39Full];
};
checks = import ./nix/checks {inherit pkgs;};
});
}