Skip to content

Commit b202579

Browse files
committed
build: custom jailed agents
1 parent a62a540 commit b202579

2 files changed

Lines changed: 239 additions & 27 deletions

File tree

flake.lock

Lines changed: 231 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
inputs.nixpkgs.follows = "nixpkgs";
1818
};
1919
crane.url = "github:ipetkov/crane";
20+
agents-jail.url = "github:gfauredev/nix-agents-jail";
2021
};
2122
outputs =
2223
{
2324
self,
2425
nixpkgs,
2526
rust-overlay,
27+
agents-jail,
2628
crane,
2729
}:
2830
let
@@ -271,32 +273,6 @@
271273
maestro test --headless "${self}/maestro/android"
272274
'';
273275
};
274-
sandbox =
275-
let
276-
pkgs = env.pkgs;
277-
devShellExecutable = pkgs.writeShellScriptBin "logout-devshell" ''
278-
exec ${pkgs.nix}/bin/nix develop "path:$PWD" "$@"
279-
'';
280-
in
281-
pkgs.dockerTools.buildLayeredImage {
282-
name = "logout-sandbox";
283-
tag = "latest";
284-
contents = [
285-
pkgs.nix
286-
devShellExecutable
287-
pkgs.cacert
288-
];
289-
config = {
290-
Cmd = [ "${devShellExecutable}/bin/logout-devshell" ];
291-
Env = [
292-
"PATH=/bin"
293-
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
294-
"NIX_CONFIG=experimental-features = nix-command flakes"
295-
"NIX_PAGER=cat"
296-
"SHELL=${pkgs.bashInteractive}/bin/bash"
297-
];
298-
};
299-
};
300276
default = env.pkgs.symlinkJoin {
301277
name = "logout-all";
302278
paths = [
@@ -349,6 +325,12 @@
349325
typescript-language-server # TypeScript LSP
350326
vscode-langservers-extracted # HTML/CSS/JS(ON)
351327
yaml-language-server # YAML LSP
328+
(agents-jail.lib.${system}.mkCrush {
329+
extraPkgs = env.commonNativeBuildInputs ++ env.androidNativeBuildInputs;
330+
})
331+
(agents-jail.lib.${system}.mkOpencode {
332+
extraPkgs = env.commonNativeBuildInputs ++ env.androidNativeBuildInputs;
333+
})
352334
];
353335
nativeBuildInputs = env.commonNativeBuildInputs ++ env.androidNativeBuildInputs;
354336
buildInputs = env.commonBuildInputs;

0 commit comments

Comments
 (0)