about summary refs log tree commit diff
path: root/tools/govanity/default.nix
blob: 750b91fc7669bfa2213398415775dddc25065935 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ pkgs, buildGoModule, ... }:

buildGoModule rec {
  name = "govanity";
  src = ./.;
  vendorSha256 = "sha256-iu2QE+vvenFWpOOz1NHVQHudiWkvkKqZvD4ZX4Xa1sY=";
  nativeBuildInputs = with pkgs; [ go ];

  deploy = pkgs.pkgs.writeShellScriptBin "run-deploy" ''
    set -euo pipefail
    export PATH=${pkgs.lib.makeBinPath [ pkgs.go pkgs.flyctl ]}:$PATH

    cd ${src}

    # run the tests, if they fail, we bail
    echo "running tests ...."
    ${pkgs.go}/bin/go test -v

    echo "deploying ...."
    ${pkgs.flyctl}/bin/flyctl deploy
  '';

  meta = with pkgs.lib; {
    description = "simple server for golang packages";
    homepage = "https://golang.fcuny.net";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = [ ];
  };
}