forked from google/ent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (50 loc) · 1.52 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
{
description = "ent-plus";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils";
gomod2nix.url = "github:nix-community/gomod2nix";
};
outputs = { self, nixpkgs, flake-utils, gomod2nix } :
(flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
gomod2nix.overlays.default
];
};
ent-server = pkgs.buildGoApplication {
pname = "ent-server";
version = "0.1.0";
pwd = ./.;
src = ./cmd/ent-server;
modules = ./gomod2nix.toml;
};
ent-server-docker = pkgs.dockerTools.buildImage {
name = "ent-server";
config = { Cmd = [ "${ent-server}/bin/rust_nix_blog" ]; };
};
in {
packages = {
ent-server = ent-server;
ent-server-docker = ent-server-docker;
};
defaultPackage = ent-server;
devShell =
pkgs.mkShell {
packages = [
pkgs.gomod2nix
];
buildInputs = [
pkgs.go
pkgs.gopls
pkgs.just
pkgs.protobuf
pkgs.protoc-gen-go
pkgs.protoc-gen-go-grpc
];
};
}));
}