-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
123 lines (106 loc) · 2.89 KB
/
flake.nix
File metadata and controls
123 lines (106 loc) · 2.89 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
description = "Nix flake for development";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
devenv = {
url = "github:cachix/devenv";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
};
git-hooks = {
url = "github:cachix/git-hooks.nix";
};
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devenv.flakeModule
inputs.git-hooks.flakeModule
];
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
config,
self',
inputs',
pkgs,
system,
...
}:
{
imports = [
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
}
];
devenv = {
shells = {
default = {
git-hooks = {
hooks = {
nixfmt-rfc-style = {
enable = true;
};
gofmt = {
enable = true;
};
golangci-lint = {
enable = true;
entry = "go tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint run ./...";
pass_filenames = false;
};
};
};
languages = {
go = {
enable = true;
package = pkgs.go_1_24;
};
};
packages = with pkgs; [
go-task
goreleaser
nixfmt-rfc-style
];
env = {
CGO_ENABLED = "0";
ERRORS_LOG_LEVEL = "debug";
ERRORS_LOG_PRETTY = "true";
ERRORS_LOG_COLOR = "true";
};
processes = {
server = {
exec = "task watch";
process-compose = {
readiness_probe = {
exec.command = "${pkgs.curl}/bin/curl -sSf http://localhost:8080/readyz";
initial_delay_seconds = 2;
period_seconds = 10;
timeout_seconds = 4;
success_threshold = 1;
failure_threshold = 5;
};
availability = {
restart = "on_failure";
};
};
};
};
};
};
};
};
};
}