feat: add nix flake package
This commit is contained in:
parent
5a0550c259
commit
9db7c21fee
2 changed files with 77 additions and 0 deletions
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1780030872,
|
||||
"narHash": "sha256-u6WU/yd/o8iYQrHX3RAwO1hYa3LkoSL+WNQD0rJfJZQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e9a7635a57597d9754eccebdfc7045e6c8600e6b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
50
flake.nix
Normal file
50
flake.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
description = "ihtc — SNI-based DPI bypass via TLS ClientHello fragmentation";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
forAllSystems = nixpkgs.lib.genAttrs [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
mkPackage = system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
version = builtins.substring 0 8 (self.lastModifiedDate or "19700101");
|
||||
in
|
||||
pkgs.buildGoModule {
|
||||
pname = "ihtc";
|
||||
version = "0.1.0-${version}";
|
||||
src = ./.;
|
||||
vendorHash = null;
|
||||
meta = with pkgs.lib; {
|
||||
description = "SNI-based DPI bypass via TLS ClientHello fragmentation";
|
||||
homepage = "https://github.com/kreatoo/ihtc";
|
||||
license = licenses.mit;
|
||||
mainProgram = "ihtc";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system: {
|
||||
default = mkPackage system;
|
||||
ihtc = mkPackage system;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [ go gopls gotools ];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue