-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
118 lines (104 loc) · 3.17 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
nixConfig = {
bash-prompt-prefix = "(proj) ";
};
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
lib = pkgs.lib;
packages = rec {
proj = pkgs.python3Packages.callPackage ./pkgs/proj {
inherit pytest-skip-slow;
inherit bencher-cli;
inherit ff-clang-format;
# for perf the kernel version doesn't matter as it's entirely in perl
# see https://discourse.nixos.org/t/which-perf-package/22399
perf = pkgs.linuxPackages_latest.perf;
callPackage = path: args: pkgs.callPackage path (packages // args);
};
bencher-cli = pkgs.callPackage ./pkgs/bencher.nix { };
ff-clang-format = pkgs.callPackage ./pkgs/ff-clang-format.nix { };
doctest = pkgs.callPackage ./pkgs/doctest { };
pytest-skip-slow = pkgs.python3Packages.callPackage ./pkgs/pytest-skip-slow.nix { };
proj-nvim = pkgs.callPackage ./pkgs/proj-nvim.nix { inherit proj; };
rapidcheckFull = pkgs.symlinkJoin {
name = "rapidcheckFull";
paths = (with pkgs; [ rapidcheck.out rapidcheck.dev ]);
};
default = proj;
};
in
rec {
inherit packages;
checks = {
default = pkgs.runCommand "default" {} ''
${self.packages.${system}.proj}/bin/proj -h
touch $out
'';
e2e = self.packages.${system}.proj.passthru.tests.e2e;
};
apps = {
default = {
type = "app";
program = "${self.packages.${system}.proj}/bin/proj";
};
# ci = pkgs.symlinkJoin {
# name = my-name;
# paths = builtins.concatList [
# (pkgs.writeShellScriptBin "ci" "pytest")
# self.packages.${system}.proj.propagatedBuildInputs
# ];
# buildInputs = [ pkgs.makeWrapper ];
# postBuild = "wrapProgram $out/bin/${my-name} --prefix PATH : $out/bin";
#
# };
# }
};
devShells = {
ci = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.proj ];
};
default = pkgs.mkShell {
inputsFrom = [
self.packages.${system}.proj
self.checks.${system}.e2e
];
buildInputs = builtins.concatLists [
(with pkgs; [
cmake
ccache
nlohmann_json
fmt
cmake
gbenchmark
])
(with pkgs.python3Packages; [
pip
ipython
mypy
python-lsp-server
pylsp-mypy
python-lsp-ruff
black
toml
pytest
])
(with self.packages.${system}; [
rapidcheckFull
pytest-skip-slow
doctest
])
];
};
};
}
);
}
# vim: set tabstop=2 shiftwidth=2 expandtab: