-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
59 lines (50 loc) · 1.68 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
{
description = "docker c++ builder (using nix)";
# dependencies
inputs = rec {
nixpkgs.url = "github:nixos/nixpkgs/23.05";
};
# see also ~/public_html/flake.nix
outputs = { self, nixpkgs } :
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
# hello_deriv = pkgs.writeShellScriptBin "entrypoint.sh" ''
# echo "Hello $1"
# time=$(date)
# echo "time=$time" >> $GITHUB_OUTPUT
# '';
docker_builder_deriv =
pkgs.dockerTools.buildLayeredImage {
name = "docker-cpp-builder";
tag = "v3";
contents = [ self.packages.${system}.git
self.packages.${system}.cacert
self.packages.${system}.gnumake
self.packages.${system}.gcc
self.packages.${system}.binutils
self.packages.${system}.bash
# for /bin/tail, assumed by github actions when invoking a docker contianer
self.packages.${system}.coreutils ];
# config = {
# Cmd = [ "/bin/entrypoint.sh" ];
# WorkingDir = "/";
# };
};
in rec {
packages.${system} = {
default = docker_builder_deriv;
docker_builder = docker_builder_deriv;
git = pkgs.git;
cacert = pkgs.cacert;
gnumake = pkgs.gnumake;
gcc = pkgs.gcc;
binutils = pkgs.binutils;
bash = pkgs.bash;
#cmake = pkgs.cmake;
# note: _all_ containers used for github actions will need this
# (of cource cmake/c++ need it anyway)
coreutils = pkgs.coreutils;
};
};
}