-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
70 lines (61 loc) · 2.06 KB
/
Copy pathflake.nix
File metadata and controls
70 lines (61 loc) · 2.06 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
{
description = "Nix-packaged base image for wizard AHE task environments";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
# python3 with pytest importable (`python3 -m pytest` and `pytest` both work).
python = pkgs.python312.withPackages (ps: [ ps.pytest ]);
in
{
packages.${system} = {
taskImage = pkgs.dockerTools.streamLayeredImage {
name = "wizard-ahe/task-base";
tag = "latest";
contents = [
# /bin/sh, /usr/bin/env, /etc/passwd & friends
pkgs.dockerTools.binSh
pkgs.dockerTools.usrBinEnv
pkgs.dockerTools.fakeNss
pkgs.bash
pkgs.coreutils
pkgs.gnugrep
pkgs.gnused
pkgs.gawk
pkgs.findutils
pkgs.diffutils
pkgs.gnumake
pkgs.gnutar
pkgs.gzip
pkgs.git
python
pkgs.cacert
];
# Runs in the image root while building the customisation layer.
# /usr/local/bin must exist: harbor `docker compose cp`s the
# agent binary to /usr/local/bin/wizard and cp fails if the
# parent directory is missing.
extraCommands = ''
mkdir -p tmp app logs usr/local/bin root
chmod 1777 tmp
'';
config = {
Env = [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
"SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"
# fakeNss gives root a /var/empty home; agents expect ~/.wizard
# etc. under /root (matching Debian-based images).
"HOME=/root"
];
WorkingDir = "/app";
Cmd = [ "/bin/bash" ];
};
};
default = self.packages.${system}.taskImage;
};
devShells.${system}.default = pkgs.mkShell {
packages = [ pkgs.uv pkgs.python312 ];
};
};
}