From 304123013fca0bd52bfc2548ab7455901347d332 Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sat, 18 May 2024 23:21:47 +0800 Subject: [PATCH 1/5] fix(typo): no -> not --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index b7b0081310..ad269d1fe6 100644 --- a/default.nix +++ b/default.nix @@ -19,7 +19,7 @@ buildGoApplication { src = ./.; # spec go version manually bcs # https://github.com/nix-community/gomod2nix/blob/30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6/builder/default.nix#L130 - # do no work + # do not work go = pkgs.go_1_20; modules = ./gomod2nix.toml; } From 0fcd9c5e8801cbc9601a580a2e7b1c3ea6093bda Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sat, 18 May 2024 23:55:19 +0800 Subject: [PATCH 2/5] fix: update version --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index ad269d1fe6..ecde3a4a81 100644 --- a/default.nix +++ b/default.nix @@ -14,7 +14,7 @@ }: buildGoApplication { pname = "ZeroBot-Plugin"; - version = "1.7.6"; + version = "1.8.0"; pwd = ./.; src = ./.; # spec go version manually bcs From 72e3514e440e482d01ad08e765af5c2a0a69facf Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sat, 18 May 2024 23:55:37 +0800 Subject: [PATCH 3/5] feat: use nix to build docker image --- flake.nix | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 3493c0eda3..fef1239b9f 100644 --- a/flake.nix +++ b/flake.nix @@ -22,11 +22,25 @@ callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; in { # doCheck will fail at write files - packages.default = - (callPackage ./. { - inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; - }) - .overrideAttrs (_: {doCheck = false;}); + packages = rec { + + ZeroBot-Plugin = + (callPackage ./. { + inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; + }) + .overrideAttrs (_: {doCheck = false;}); + + default = ZeroBot-Plugin; + + docker_builder = pkgs.dockerTools.buildLayeredImage { + name = "ZeroBot-Plugin"; + tag = "latest"; + contents = [ + self.packages.${system}.ZeroBot-Plugin + ]; + }; + + }; devShells.default = callPackage ./shell.nix { inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix; }; From 395f1c615520cc556badbf78241502e1b851bfeb Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sat, 18 May 2024 23:56:10 +0800 Subject: [PATCH 4/5] feat: ignore nix result --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2d1d82a57f..ffa2ed68ce 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ zerobot ZeroBot-Plugin* *.syso /.direnv +/result \ No newline at end of file From c822246c95953d603d3de8f4da64bc17da9e77ca Mon Sep 17 00:00:00 2001 From: Nobody6825 <117302867+Nobooooody@users.noreply.github.com> Date: Sun, 19 May 2024 00:03:05 +0800 Subject: [PATCH 5/5] fix(nix docker builder): failed to verify certificate --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index fef1239b9f..15e1b71cf3 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,7 @@ tag = "latest"; contents = [ self.packages.${system}.ZeroBot-Plugin + pkgs.cacert ]; };