-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
63 lines (51 loc) · 1.73 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
{
description = "Wayland signal/listener wrapper for C++";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs"; };
outputs = { self, nixpkgs }:
let
allSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in {
overlay = final: prev: rec {
waysig = with final;
stdenv.mkDerivation rec {
name = "waysig-${version}";
version = "0.3.2";
src = ./.;
nativeBuildInputs = [ cmake catch2 pkg-config wayland ];
doCheck = true;
checkTarget = "test";
cmakeFlags =
[ "-DWAYSIG_BUILD_TESTS=ON" "-DWAYSIG_BUILD_TESTS_WAYLAND=ON" ];
meta = with stdenv.lib; {
homepage = "https://github.com/dreyri/waysig";
description = "Wayland signal/listener wrapper for C++";
license = licenses.mit;
};
};
};
packages =
forAllSystems (system: { inherit (nixpkgsFor.${system}) waysig; });
defaultPackage = forAllSystems (system: self.packages.${system}.waysig);
devShell = forAllSystems (system:
let pkgs = import nixpkgs { inherit system; };
in with pkgs;
mkShell {
buildInputs =
[ pkgconfig ccls cmake wayland extra-cmake-modules catch2 ];
shellHook = ''
cat << EOF > .ccls
%compile_commands.json
%cpp -std=c++14
-Iinclude
-I${pkgs.wayland}/include
EOF
'';
});
};
}