2022-10-01 22:34:39 +08:00
|
|
|
{
|
|
|
|
description = "Another Clash Kernel";
|
|
|
|
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/master";
|
|
|
|
|
|
|
|
inputs.utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils }:
|
2022-10-02 02:15:37 +08:00
|
|
|
utils.lib.eachDefaultSystem
|
2022-10-01 22:34:39 +08:00
|
|
|
(system:
|
|
|
|
let
|
2022-10-02 18:29:20 +08:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlay ];
|
2022-10-02 02:15:37 +08:00
|
|
|
};
|
2022-10-02 18:29:20 +08:00
|
|
|
in
|
|
|
|
rec {
|
|
|
|
packages.default = pkgs.clash-meta;
|
|
|
|
}
|
|
|
|
) //
|
|
|
|
(
|
|
|
|
let version = nixpkgs.lib.substring 0 8 self.lastModifiedDate or self.lastModified or "19700101"; in
|
|
|
|
{
|
|
|
|
overlay = final: prev: {
|
|
|
|
|
2022-12-15 13:25:56 +08:00
|
|
|
clash-meta = final.buildGo119Module {
|
2022-10-02 18:29:20 +08:00
|
|
|
pname = "clash-meta";
|
|
|
|
inherit version;
|
|
|
|
src = ./.;
|
|
|
|
|
2022-12-15 13:25:56 +08:00
|
|
|
vendorSha256 = "sha256-XVz2vts4on42lfxnov4jnUrHzSFF05+i1TVY3C7bgdw=";
|
2022-10-02 18:29:20 +08:00
|
|
|
|
|
|
|
# Do not build testing suit
|
|
|
|
excludedPackages = [ "./test" ];
|
|
|
|
|
|
|
|
CGO_ENABLED = 0;
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/Dreamacro/clash/constant.Version=dev-${version}"
|
|
|
|
"-X github.com/Dreamacro/clash/constant.BuildTime=${version}"
|
|
|
|
];
|
2022-10-08 15:40:41 +08:00
|
|
|
|
|
|
|
tags = [
|
|
|
|
"with_gvisor"
|
|
|
|
];
|
2022-10-02 18:29:20 +08:00
|
|
|
|
|
|
|
# Network required
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/clash $out/bin/clash-meta
|
|
|
|
'';
|
2022-10-02 02:15:37 +08:00
|
|
|
|
|
|
|
};
|
2022-10-02 18:29:20 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
2022-10-01 22:34:39 +08:00
|
|
|
}
|
2022-10-02 02:15:37 +08:00
|
|
|
|