Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Nix Build"

on:
workflow_dispatch:
pull_request:
push:
branches: [main, master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@v8
- run: nix build
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,37 @@ proxy-groups:
sudo apt-get install libkeybinder-3.0-dev
```

### ❄️ NixOS

Добавьте репозиторий в `inputs` флейка и подключите оверлей:

`flake.nix`
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Новый инпут
flclashx.url = "github:pluralplay/FlClashX";
};

outputs = { self, nixpkgs, flclashx, ... }: {
nixosConfigurations.myhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
# Оверлей
nixpkgs.overlays = [ flclashx.overlays.default ];

# Установка пакета
environment.systemPackages = [ pkgs.flclashx ];
}
];
};
};
}
```


### Android

Поддерживаются следующие действия:
Expand All @@ -423,3 +454,4 @@ proxy-groups:
Если хотите поддержать копеечкой, то можно <a href="https://t.me/tribute/app?startapp=dtyh">сделать это тут.</a></p>

**TON USDT:** `UQDSfrJ_k1BdsknhdR_zj4T3Is3OdMylD8PnDJ9mxO35i-TE`

37 changes: 37 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,38 @@ By default, the following configuration parameters received from the subscriptio
sudo apt-get install libkeybinder-3.0-dev
```

### ❄️ NixOS

Add the repository to your flake's `inputs` and apply the overlay:

`flake.nix`

```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# New input
flclashx.url = "github:pluralplay/FlClashX";
};

outputs = { self, nixpkgs, flclashx, ... }: {
nixosConfigurations.myhostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
# Overlay
nixpkgs.overlays = [ flclashx.overlays.default ];

# Install the package
environment.systemPackages = [ pkgs.flclashx ];
}
];
};
};
}

```

### Android

The following actions are supported:
Expand All @@ -341,3 +373,8 @@ If you want to support with a small donation, you can <a href="https://t.me/trib
</p>

**TON USDT:** `UQDSfrJ_k1BdsknhdR_zj4T3Is3OdMylD8PnDJ9mxO35i-TE`
<div>

[**Russian**](README.md)

</div>
61 changes: 61 additions & 0 deletions flake.lock

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

120 changes: 120 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
description = "A fork of the multi-platform proxy client FlClash, based on original Mihomo Core, simple and easy to use, open source and ad-free.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };

version = self.shortRev or self.dirtyShortRev or "unknown";

# HASHES
# ==========================================================

vendorHash = "sha256-BsFT/KrD8SX3edFtipK/eaJvVopvOCmTiw+Ydh+oa0s=";
gitHashes = {
flutter_js = "sha256-4PgiUL7aBnWVOmz2bcSxKt81BRVMnopabj5LDbtPYk4=";
};

# ==========================================================

src = pkgs.lib.cleanSource ./.;

flclashCore = pkgs.buildGoModule {
pname = "flclashx-core";
inherit version src vendorHash;
modRoot = "core";
env = {
CGO_ENABLED = "0";
};
buildPhase = ''
runHook preBuild
go build \
-tags=with_gvisor \
-trimpath \
-ldflags="-w -s -X github.com/metacubex/mihomo/constant.Version=${version}" \
-o FlClashCore .
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 FlClashCore $out/bin/FlClashCore
runHook postInstall
'';
doCheck = false;
};

flclashx = pkgs.flutter.buildFlutterApplication {
pname = "flclashx";
inherit version src gitHashes;
pubspecLock = builtins.fromJSON (
builtins.readFile (
pkgs.runCommand "pubspec.lock.json" { } ''
${pkgs.yq-go}/bin/yq -o=json ${./pubspec.lock} > $out
''
)
);
preBuild = ''
mkdir -p libclash/linux
cp ${flclashCore}/bin/FlClashCore libclash/linux/FlClashCore
'';
nativeBuildInputs = with pkgs; [
pkg-config
wrapGAppsHook3
];
buildInputs = with pkgs; [
gtk3
glib
gdk-pixbuf
cairo
pango
atk
harfbuzz
libepoxy
libayatana-appindicator
keybinder3
libX11
libXcursor
libXrandr
libXinerama
libXi
];
meta = with pkgs.lib; {
homepage = "https://github.com/pluralplay/FlClashX";
license = licenses.gpl3Only;
mainProgram = "FlClashX";
platforms = platforms.linux;
};
};
in
{
packages = rec {
default = flclashx;
inherit flclashx;
flclashx-core = flclashCore;
};
devShells.default = pkgs.mkShell {
inputsFrom = [ flclashx ];
nativeBuildInputs = with pkgs; [
flutter
go
yq-go
];
};
}
)
// {
overlays.default = final: prev: {
flclashx = self.packages.${final.system}.flclashx;
};
};
}