Skip to content

Commit

Permalink
fix(nix): Update Flake
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
  • Loading branch information
stv0g committed Jun 15, 2024
1 parent bd11817 commit 134a200
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 24 deletions.
8 changes: 8 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ buildGoModule, libpcap }:
buildGoModule {
name = "gont";
src = ./.;
vendorHash = "sha256-9/TPK8MD1lA9s3jhKmHweY7quw383kHgrcL2XLyuQ54=";
buildInputs = [ libpcap ];
doCheck = false;
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 52 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,62 @@
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {
packages.gont = pkgs.buildGoModule {
name = "gont";
src = ./.;
vendorHash = "sha256-QOh1jBR7FL/fKFmJv7wGxuCghRLR3DV/0TzXd+bUFP0=";
buildInputs = with pkgs; [ libpcap ];
doCheck = false;
pkgs = import nixpkgs {
inherit system;
inherit overlays;
};

devShell = pkgs.mkShell {
packages = with pkgs; [
golangci-lint
reuse
traceroute
gnumake
tshark
packages.gont
];

inputsFrom = [ packages.gont ];
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
];

inputsFrom = with pkgs; [ gont ];

hardeningDisable = [ "fortify" ];
};

formatter = nixpkgs.nixfmt-rfc-style;
formatter = pkgs.nixfmt-rfc-style;
}
);
}

0 comments on commit 134a200

Please sign in to comment.