|
1 | 1 | {
|
2 | 2 | description = "基于 ZeroBot 的 OneBot 插件";
|
3 | 3 |
|
4 |
| - # pin nixpkgs to preserve dropped go_1_20 |
5 |
| - inputs.nixpkgs.url = "github:NixOS/nixpkgs/33c51330782cb486764eb598d5907b43dc87b4c2"; |
| 4 | + inputs.nixpkgs-with-go_1_20.url = "github:NixOS/nixpkgs/33c51330782cb486764eb598d5907b43dc87b4c2"; |
| 5 | + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
6 | 6 | inputs.flake-utils.url = "github:numtide/flake-utils";
|
7 | 7 | inputs.gomod2nix.url = "github:nix-community/gomod2nix";
|
8 | 8 | inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
11 | 11 | outputs = {
|
12 | 12 | self,
|
13 | 13 | nixpkgs,
|
| 14 | + nixpkgs-with-go_1_20, |
14 | 15 | flake-utils,
|
15 | 16 | gomod2nix,
|
16 |
| - }: let |
| 17 | + ... |
| 18 | + } @ inputs: let |
17 | 19 | allSystems = flake-utils.lib.allSystems;
|
18 | 20 | in (
|
19 | 21 | flake-utils.lib.eachSystem allSystems
|
20 | 22 | (system: let
|
21 |
| - pkgs = nixpkgs.legacyPackages.${system}; |
| 23 | + old-nixpkgs = nixpkgs-with-go_1_20.legacyPackages.${system}; |
| 24 | + pkgs = import nixpkgs { |
| 25 | + inherit system; |
| 26 | + |
| 27 | + overlays = [ |
| 28 | + (_: _: { |
| 29 | + go_1_20 = old-nixpkgs.go_1_20; |
| 30 | + }) |
| 31 | + ]; |
| 32 | + }; |
22 | 33 |
|
23 | 34 | # The current default sdk for macOS fails to compile go projects, so we use a newer one for now.
|
24 | 35 | # This has no effect on other platforms.
|
25 | 36 | callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage;
|
26 | 37 | in {
|
27 | 38 | # doCheck will fail at write files
|
28 | 39 | packages = rec {
|
29 |
| - |
30 |
| - ZeroBot-Plugin = |
31 |
| - (callPackage ./. { |
| 40 | + ZeroBot-Plugin = (callPackage ./. (inputs |
| 41 | + // { |
32 | 42 | inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
|
33 |
| - }) |
| 43 | + })) |
34 | 44 | .overrideAttrs (_: {doCheck = false;});
|
35 | 45 |
|
36 | 46 | default = ZeroBot-Plugin;
|
|
43 | 53 | pkgs.cacert
|
44 | 54 | ];
|
45 | 55 | };
|
46 |
| - |
47 | 56 | };
|
48 | 57 | devShells.default = callPackage ./shell.nix {
|
49 | 58 | inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix;
|
|
0 commit comments