-
Notifications
You must be signed in to change notification settings - Fork 6
/
flake.nix
79 lines (69 loc) · 2 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
# SPDX-FileCopyrightText: 2023 Steffen Vogel <post@steffenvogel.de>
# SPDX-License-Identifier: Apache-2.0
{
description = "Gont: A Go testing framework for distributed applications";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
inherit overlays;
};
overlay = final: prev: { gont = final.callPackage ./default.nix { }; };
overlays = [ overlay ];
luaPkgs = {
lua-struct = pkgs.lua.pkgs.buildLuarocksPackage {
pname = "lua-struct";
version = "0.9.2-1";
src = pkgs.fetchFromGitHub {
owner = "iryont";
repo = "lua-struct";
rev = "0.9.2-1";
hash = "sha256-tyZU+Cm/f3urG3A5nBFC2NZ9nwtWh1yD4Oj0MHRtDlI=";
};
};
};
in
{
inherit overlays;
packages.default = pkgs.gont;
devShell =
let
tshark = pkgs.tshark.overrideAttrs (
final: prev: {
# Make sure we can load our own Lua dissector plugin
# by Wiresharks Lua interpreter when tests are executed by root
postFixup = ''
echo "run_user_scripts_when_superuser = true" >> $out/lib/wireshark/plugins/init.lua
'';
}
);
in
pkgs.mkShell {
packages = with pkgs // luaPkgs; [
golangci-lint
reuse
traceroute
gnumake
tshark
gont
lua-struct
yarn-berry
];
inputsFrom = with pkgs; [ gont ];
hardeningDisable = [ "fortify" ];
};
formatter = pkgs.nixfmt-rfc-style;
}
);
}