-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (53 loc) · 1.51 KB
/
flake.nix
File metadata and controls
60 lines (53 loc) · 1.51 KB
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
{
description = "bonk-api";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
inputs.flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1";
outputs =
{ self
, nixpkgs
, ...
} @ inputs:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
name = "bonk";
packages = with pkgs; [
go
flyctl
skopeo
codespell
nixpkgs-fmt
];
};
});
packages = forEachSupportedSystem ({ pkgs }: rec {
default = bonk;
bonk = pkgs.buildGoModule {
pname = "bonk";
version = "unreleased";
src = ./.;
goSum = ./go.sum;
vendorHash = "sha256-Ixz+SBVI7+D3rixa+L7Q4q3n1VFDuWF6Htx8+cY+aKo=";
};
dockerImage =
let
linuxPkgs = nixpkgs.legacyPackages.x86_64-linux;
in
pkgs.dockerTools.buildLayeredImage {
name = "bonk";
contents = [ linuxPkgs.cacert bonk ];
maxLayers = 300;
config = {
ExposedPorts."80/tcp" = { };
Cmd = [ "${self.packages.x86_64-linux.bonk}/bin/bonk" ];
};
};
});
};
}