-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (48 loc) · 1.37 KB
/
flake.nix
File metadata and controls
49 lines (48 loc) · 1.37 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
devShells = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
goarrange = pkgs.buildGoModule {
pname = "goarrange";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
owner = "jdeflander";
repo = "goarrange";
rev = "v1.0.0";
hash = "sha256-V03BgTeWcAspMHGUHlAgSbiTaoZ42hgb/Zb/yqZ2m+k=";
};
vendorHash = "sha256-Xhxfiw1WeXFHrYIYvUytEtMzMbSxOrignmUC5kVna0o=";
};
lint = pkgs.writeShellScriptBin "lint" ''
set -euo pipefail
echo "--- format ---"
go fmt ./...
goarrange run -r
echo "--- lint ---"
golangci-lint run -E misspell,godot,whitespace ./...
echo "--- tidy ---"
go mod tidy
'';
in
{
default = pkgs.mkShell {
packages = [
pkgs.go_1_26
pkgs.golangci-lint
goarrange
lint
];
};
}
);
};
}