about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-05-29 09:26:54 -0700
committerFranck Cuny <franck@fcuny.net>2022-05-29 09:26:54 -0700
commitdb287fad6d4cebf78c2c172b068fe4774ced667a (patch)
tree2fd903e585320ac6b698792b9cfdf099866b5f8e
parenttools(govanity): remove unneeded files (diff)
downloadworld-db287fad6d4cebf78c2c172b068fe4774ced667a.tar.gz
tools(govanity): add the tool to flake.nix
Change-Id: Ib2792fa8c3f861d290f2495a10672cdfd11c48d9
-rw-r--r--flake.nix5
-rw-r--r--tools/govanity/default.nix24
2 files changed, 28 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 685e66d..1df7a17 100644
--- a/flake.nix
+++ b/flake.nix
@@ -55,7 +55,10 @@
         packages = pkgs // {
           inherit home-manager;
 
-          tools = { dnsupdate = import ./tools/dnsupdate { inherit pkgs; }; };
+          tools = {
+            dnsupdate = import ./tools/dnsupdate { inherit pkgs; };
+            govanity = import ./tools/govanity { inherit pkgs; };
+          };
 
           users.fcuny = {
             blog = import ./users/fcuny/blog { inherit pkgs; };
diff --git a/tools/govanity/default.nix b/tools/govanity/default.nix
new file mode 100644
index 0000000..10652ff
--- /dev/null
+++ b/tools/govanity/default.nix
@@ -0,0 +1,24 @@
+{ pkgs, ... }:
+
+pkgs.buildGoModule rec {
+  name = "govanity";
+  src = ./.;
+  vendorSha256 = "sha256-iu2QE+vvenFWpOOz1NHVQHudiWkvkKqZvD4ZX4Xa1sY=";
+  nativeBuildInputs = with pkgs; [ go ];
+
+  deploy = pkgs.pkgs.writeShellScriptBin "run-deploy" ''
+    set -euxo pipefail
+    export PATH=${
+      pkgs.lib.makeBinPath [ pkgs.go pkgs.git pkgs.jq pkgs.flyctl ]
+    }:$PATH
+    bash ./scripts/deploy.sh
+  '';
+
+  meta = with pkgs.lib; {
+    description = "simple server for golang packages";
+    homepage = "https://golang.fcuny.net";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ ];
+  };
+}