about summary refs log tree commit diff
path: root/tools/govanity/flake.nix
blob: d2c22549f57e6d960aec2efff749abc14e4caca4 (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
31
32
33
34
35
36
37
{
  description = "govanity";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
    utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, utils, nixpkgs, pre-commit-hooks }:
    utils.lib.eachDefaultSystem (system:
      let pkgs = nixpkgs.legacyPackages.${system};
      in {

        defaultPackage = self.packages.${system}.vanity;

        packages.vanity = pkgs.buildGoModule {
          pname = "vanity";
          version = "0.0.1";
          src = ./.;
          vendorSha256 = "sha256-iu2QE+vvenFWpOOz1NHVQHudiWkvkKqZvD4ZX4Xa1sY=";
          nativeBuildInputs = with pkgs; [ go ];
        };

        apps = {
          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
          '';
        };

        devShell = with pkgs;
          mkShell { nativeBuildInputs = [ git go gopls golangci-lint bash ]; };
      });
}