Skip to content

Commit 7f202a3

Browse files
author
nayeko
authored
flclash: refactor
1 parent 56627a7 commit 7f202a3

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

pkgs/by-name/fl/flclash/package.nix

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
buildGoModule,
88
makeDesktopItem,
99
copyDesktopItems,
10-
wrapGAppsHook3,
1110
autoPatchelfHook,
1211
}:
12+
1313
let
1414
pname = "flclash";
1515
version = "0.8.70";
16+
1617
src =
1718
(fetchFromGitHub {
1819
owner = "chen08209";
@@ -26,10 +27,19 @@ let
2627
GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf";
2728
GIT_CONFIG_VALUE_0 = "[email protected]:";
2829
});
30+
31+
metaCommon = {
32+
description = "Multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free";
33+
homepage = "https://github.com/chen08209/FlClash";
34+
license = with lib.licenses; [ gpl3Plus ];
35+
maintainers = with lib.maintainers; [ ];
36+
};
37+
2938
libclash = buildGoModule {
30-
inherit pname version src;
39+
inherit version src;
40+
pname = "libclash";
3141

32-
modRoot = "./core";
42+
modRoot = "core";
3343

3444
vendorHash = "sha256-yam3DgY/dfwIRc7OvFltwX29x6xGlrrsK4Oj6oaGYRw=";
3545

@@ -44,12 +54,7 @@ let
4454
runHook postBuild
4555
'';
4656

47-
meta = {
48-
description = "Multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free";
49-
homepage = "https://github.com/chen08209/FlClash";
50-
license = with lib.licenses; [ gpl3Plus ];
51-
maintainers = with lib.maintainers; [ ];
52-
};
57+
meta = metaCommon;
5358
};
5459
in
5560
flutter324.buildFlutterApplication {
@@ -59,7 +64,6 @@ flutter324.buildFlutterApplication {
5964

6065
nativeBuildInputs = [
6166
copyDesktopItems
62-
wrapGAppsHook3
6367
autoPatchelfHook
6468
];
6569

@@ -88,22 +92,21 @@ flutter324.buildFlutterApplication {
8892
];
8993

9094
preBuild = ''
91-
mkdir -p ./libclash/linux/
92-
cp ${libclash}/bin/FlClashCore ./libclash/linux/FlClashCore
95+
mkdir -p libclash/linux
96+
cp ${libclash}/bin/FlClashCore libclash/linux/FlClashCore
9397
'';
9498

9599
postInstall = ''
96-
install -Dm644 ./assets/images/icon.png $out/share/pixmaps/flclash.png
100+
install -Dm644 assets/images/icon.png $out/share/pixmaps/flclash.png
97101
'';
98102

99-
passthru.updateScript = ./update.sh;
103+
passthru = {
104+
inherit libclash;
105+
updateScript = ./update.sh;
106+
};
100107

101-
meta = {
102-
description = "Multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free";
103-
homepage = "https://github.com/chen08209/FlClash";
108+
meta = metaCommon // {
104109
mainProgram = "FlClash";
105-
license = with lib.licenses; [ gpl3Plus ];
106-
maintainers = with lib.maintainers; [ ];
107110
platforms = lib.platforms.linux;
108111
};
109112
}

0 commit comments

Comments
 (0)