-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
82 lines (76 loc) · 2.2 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
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{ self, nixpkgs }:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
f pkgs
);
in
{
packages = forEachSystem (
pkgs: with pkgs; rec {
default = vsix;
vsix = callPackage ./vsix.nix { };
sysdig-vscode-ext = vscode-utils.buildVscodeExtension {
inherit (vsix.packageJson) name version;
src = vsix;
unpackPhase = "unzip $src";
vscodeExtPublisher = vsix.packageJson.publisher;
vscodeExtName = vsix.packageJson.name;
vscodeExtUniqueId = "${vsix.packageJson.publisher}.${vsix.packageJson.name}";
};
}
);
apps = forEachSystem (pkgs: {
# Builds the extension and packages is with vscode to launch it.
# To execute with: nix run .#code
# You can also execute it with the latest version in the repo: nix run github:sysdiglabs/vscode-extension#code
# Or even from a tag: nix run github:sysdiglabs/vscode-extension/0.2.6#code
code =
let
vscode-with-extension-installed = pkgs.vscode-with-extensions.override {
vscodeExtensions = [ self.packages.${pkgs.system}.sysdig-vscode-ext ];
};
in
{
type = "app";
program = "${vscode-with-extension-installed}/bin/code";
};
});
devShells = forEachSystem (
pkgs: with pkgs; {
default = mkShell {
shellHook = ''
npm ci
'';
buildInputs = [
vscode
nodejs
typescript
vsce
nodePackages.typescript-language-server
];
};
}
);
formatter = forEachSystem (pkgs: pkgs.nixfmt-rfc-style);
};
}