-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (76 loc) · 2.27 KB
/
Copy pathflake.nix
File metadata and controls
77 lines (76 loc) · 2.27 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
go-overlay.url = "github:purpleclay/go-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
go-overlay,
flake-utils,
}:
let
overlays.default = final: prev: {
sysdig-mcp-server =
if prev.stdenv.isLinux then
prev.pkgsStatic.callPackage ./package.nix { }
else
prev.callPackage ./package.nix { };
};
useLatestGoVersion = final: prev: {
go_latest = final.go-bin.latestStable;
# Use buildPackages so the Go toolchain runs on the build platform while
# still cross-compiling for the target (matches nixpkgs' buildGo*Module),
# otherwise cross builds pick the target-arch Go binary and fail to exec.
buildGoLatestModule = prev.buildGoLatestModule.override { go = final.buildPackages.go-bin.latestStable; };
};
flake = flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
self.overlays.default
go-overlay.overlays.default
useLatestGoVersion
];
};
in
{
packages = {
inherit (pkgs) sysdig-mcp-server;
default = pkgs.sysdig-mcp-server;
sysdig-mcp-server-image-amd64 = pkgs.pkgsCross.gnu64.callPackage ./docker.nix { };
sysdig-mcp-server-image-aarch64 = pkgs.pkgsCross.aarch64-multiplatform.callPackage ./docker.nix { };
};
devShells.default =
with pkgs;
mkShell {
packages = [
ginkgo
go_latest
govulncheck
gofumpt
golangci-lint
govulncheck
just
mockgen
nix-prefetch-docker
pinact
prek
sd
skopeo
];
shellHook = ''
prek install
'';
};
formatter = pkgs.nixfmt-rfc-style;
}
);
in
flake // { inherit overlays; };
}