-
Notifications
You must be signed in to change notification settings - Fork 10
/
flake.nix
64 lines (58 loc) · 2.09 KB
/
flake.nix
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
description =
"An AWS code artifact proxy to allow unauthenticated read access to your code artifacts";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
{
overlays.default = (final: prev: {
inherit (self.packages.${final.system}) aws-codeartifact-proxy;
});
} // flake-utils.lib.eachDefaultSystem (system:
let
package-name = "aws-codeartifact-proxy";
urn = "github.com/sktan/${package-name}";
pkgs = import nixpkgs { inherit system; };
aws-codeartifact-proxy = pkgs.buildGoModule {
pname = package-name;
name = package-name;
src = ./src;
vendorSha256 = "3MO+mRCstXw0FfySiyMSs1vaao7kUYIyJB2gAp1IE48=";
meta = with pkgs.lib; {
description =
"An AWS code artifact proxy to allow unauthenticated read access to your code artifacts";
homepage = "https://${urn}";
license = licenses.mit;
maintainers = with maintainers; [ lafrenierejm ];
};
};
in rec {
packages = flake-utils.lib.flattenTree {
# `nix build .#aws-codeartifact-proxy`
inherit aws-codeartifact-proxy;
# `nix build`
default = aws-codeartifact-proxy;
# Build an OCI image.
# `nix build .#aws-codeartifact-proxy-oci`
aws-codeartifact-proxy-docker = pkgs.dockerTools.buildLayeredImage {
name = "aws-codeartifact-proxy";
tag = "latest";
config = {
Entrypoint =
[ "${aws-codeartifact-proxy}/bin/aws-codeartifact-proxy" ];
WorkingDir = "/data";
Volumes = { "/data" = { }; };
};
};
};
# `nix run`
apps.default =
flake-utils.lib.mkApp { drv = packages.aws-codeartifact-proxy; };
# `nix develop`
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ go gopls gotools go-tools nixfmt ];
};
});
}