diff --git a/_sources/generated.json b/_sources/generated.json index 6775b14..e5b9b6f 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -119,6 +119,26 @@ }, "version": "5629d2356f62a9f2f8efad3ff37476c19969bd4f" }, + "clash-meta": { + "cargoLocks": null, + "date": null, + "extract": null, + "name": "clash-meta", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "MetaCubeX", + "repo": "mihomo", + "rev": "v1.18.1", + "sha256": "sha256-ezOkDrpytZQdc+Txe4eUyuWY6oipn9jIrmu7aO8lNlQ=", + "type": "github" + }, + "version": "v1.18.1" + }, "lporg": { "cargoLocks": null, "date": null, @@ -141,7 +161,7 @@ }, "rime-ice": { "cargoLocks": null, - "date": "2024-02-15", + "date": "2024-02-18", "extract": null, "name": "rime-ice", "passthru": null, @@ -153,10 +173,10 @@ "name": null, "owner": "iDvel", "repo": "rime-ice", - "rev": "8a2a06ecc64283650435c74490d1af1eb2b72633", - "sha256": "sha256-gZIAdwDXMkr9/GsNPhZWOFDaNsLHOeCk9+rQkG2rLGQ=", + "rev": "6d438fb8f4de5e54e0fb2e1daf0635d729277493", + "sha256": "sha256-bKwzulM6Xl3+Xr0Nk9jNKXKfbDJyPr8u90jHceCVwo8=", "type": "github" }, - "version": "8a2a06ecc64283650435c74490d1af1eb2b72633" + "version": "6d438fb8f4de5e54e0fb2e1daf0635d729277493" } } diff --git a/_sources/generated.nix b/_sources/generated.nix index c44ee64..0f9ac86 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -77,6 +77,17 @@ }; date = "2023-07-13"; }; + clash-meta = { + pname = "clash-meta"; + version = "v1.18.1"; + src = fetchFromGitHub { + owner = "MetaCubeX"; + repo = "mihomo"; + rev = "v1.18.1"; + fetchSubmodules = false; + sha256 = "sha256-ezOkDrpytZQdc+Txe4eUyuWY6oipn9jIrmu7aO8lNlQ="; + }; + }; lporg = { pname = "lporg"; version = "v20.4.31"; @@ -90,14 +101,14 @@ }; rime-ice = { pname = "rime-ice"; - version = "8a2a06ecc64283650435c74490d1af1eb2b72633"; + version = "6d438fb8f4de5e54e0fb2e1daf0635d729277493"; src = fetchFromGitHub { owner = "iDvel"; repo = "rime-ice"; - rev = "8a2a06ecc64283650435c74490d1af1eb2b72633"; + rev = "6d438fb8f4de5e54e0fb2e1daf0635d729277493"; fetchSubmodules = false; - sha256 = "sha256-gZIAdwDXMkr9/GsNPhZWOFDaNsLHOeCk9+rQkG2rLGQ="; + sha256 = "sha256-bKwzulM6Xl3+Xr0Nk9jNKXKfbDJyPr8u90jHceCVwo8="; }; - date = "2024-02-15"; + date = "2024-02-18"; }; } diff --git a/garnix.yaml b/garnix.yaml index 4dee64e..fe3fc65 100644 --- a/garnix.yaml +++ b/garnix.yaml @@ -2,5 +2,6 @@ builds: exclude: [] include: - "*.aarch64-darwin.*" + - "*.aarch64-linux.*" - "*.x86_64-darwin.*" - "*.x86_64-linux.*" diff --git a/nvfetcher.toml b/nvfetcher.toml index fe37702..811e468 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -2,6 +2,10 @@ src.github = "blacktop/lporg" fetch.github = "blacktop/lporg" +[clash-meta] +src.github = "MetaCubeX/mihomo" +fetch.github = "MetaCubeX/mihomo" + [rime-ice] src.git = "https://github.com/iDvel/rime-ice" fetch.github = "iDvel/rime-ice" diff --git a/src/packages/clash-meta.nix b/src/packages/clash-meta.nix new file mode 100644 index 0000000..18231fe --- /dev/null +++ b/src/packages/clash-meta.nix @@ -0,0 +1,61 @@ +{ + globals, + config, + self', + inputs', + pkgs, + system, + ... +}: let + recipe = { + lib, + fetchFromGitHub, + buildGoModule, + sources, + platforms, + }: + buildGoModule rec { + inherit (sources.clash-meta) pname version src; + + vendorHash = "sha256-tvPR5kAta4MlMTwjfxwVOacRr2nVpfalbN08mfxml64="; + + # Do not build testing suit + excludedPackages = ["./test"]; + + ldflags = [ + "-s" + "-w" + "-X github.com/MetaCubeX/mihomo/constant.Version=${version}" + ]; + + tags = [ + "with_gvisor" + ]; + + # network required + doCheck = false; + + postInstall = '' + mv $out/bin/mihomo $out/bin/clash-meta + ''; + + meta = with lib; { + description = "Another Clash Kernel"; + homepage = "https://github.com/MetaCubeX/mihomo"; + changelog = "https://github.com/MetaCubeX/mihomo/releases/tag/${version}"; + license = licenses.gpl3Only; + maintainers = with maintainers; [yousiki]; + mainProgram = "clash-meta"; + inherit platforms; + }; + }; + + sources = pkgs.callPackage (globals.root + /_sources/generated.nix) {}; + + platforms = import globals.inputs.default-systems; + + package = pkgs.callPackage recipe {inherit sources platforms;}; +in + if builtins.elem system platforms + then package + else null diff --git a/src/packages/lporg.nix b/src/packages/lporg.nix index 840cc91..8d10bdf 100644 --- a/src/packages/lporg.nix +++ b/src/packages/lporg.nix @@ -13,21 +13,23 @@ buildGoModule, fetchFromGitHub, installShellFiles, - sources ? {}, + sources, + platforms, }: buildGoModule rec { inherit (sources.lporg) pname version src; vendorHash = "sha256-GQaIfUtM3iDQ9jmrSMqYvcPysigdu7w10xGDIYv4OY8="; - nativeBuildInputs = [ - installShellFiles + ldflags = [ + "-s" + "-w" + "-X github.com/blacktop/lporg/constant.Version=${version}" ]; + # disable check phase checkPhase = ''''; - postInstall = ''''; - meta = with lib; { description = "Organize Your macOS Launchpad Apps"; longDescription = '' @@ -36,21 +38,23 @@ in sync across devices. ''; homepage = "https://github.com/blacktop/lporg"; - changelog = "https://github.com/blacktop/lporg/releases/tag/v${version}"; + changelog = "https://github.com/blacktop/lporg/releases/tag/${version}"; license = with licenses; [mit]; maintainers = with maintainers; [yousiki]; + mainProgram = "lporg"; + inherit platforms; }; }; sources = pkgs.callPackage (globals.root + /_sources/generated.nix) {}; - package = pkgs.callPackage recipe {inherit sources;}; - - systems = + platforms = builtins.filter - (system: pkgs.lib.hasSuffix "-darwin" system) + (pkgs.lib.hasSuffix "-darwin") (import globals.inputs.default-systems); + + package = pkgs.callPackage recipe {inherit sources platforms;}; in - if builtins.elem system systems + if builtins.elem system platforms then package else null diff --git a/src/packages/nvfetcher.nix b/src/packages/nvfetcher.nix index 54ab89d..149c049 100644 --- a/src/packages/nvfetcher.nix +++ b/src/packages/nvfetcher.nix @@ -6,11 +6,7 @@ pkgs, system, ... -}: let - package = globals.inputs.nvfetcher.packages.${pkgs.system}.default; - - systems = import globals.inputs.default-systems; -in - if builtins.elem system systems - then package - else null +}: +if pkgs.lib.hasAttr system globals.inputs.nvfetcher.packages +then globals.inputs.nvfetcher.packages.${system}.default +else null