about summary refs log tree commit diff
path: root/tools/nixery/server/builder/builder.go
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-10-03T21·13+0100
committerVincent Ambo <github@tazj.in>2019-10-03T21·50+0100
commitd9b329ef59e35ae6070eae867cf06a5230ae3d51 (patch)
tree89ad524347885a9ebc87a4deb2d383048db94696 /tools/nixery/server/builder/builder.go
parent9bb6d0ae255c1340fe16687d740fad948e6a9335 (diff)
refactor(server): Always include 'cacert' & 'iana-etc'
These two packages almost always end up being required by programs,
but people don't necessarily consider them.

They will now always be added and their popularity is artificially
inflated to ensure they end up at the top of the layer list.
Diffstat (limited to 'tools/nixery/server/builder/builder.go')
-rw-r--r--tools/nixery/server/builder/builder.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/nixery/server/builder/builder.go b/tools/nixery/server/builder/builder.go
index 614291e660c5..7f391838f604 100644
--- a/tools/nixery/server/builder/builder.go
+++ b/tools/nixery/server/builder/builder.go
@@ -87,7 +87,7 @@ type BuildResult struct {
 // be used to invoke Nix.
 //
 // It will expand convenience names under the hood (see the `convenienceNames`
-// function below).
+// function below) and append packages that are always included (cacert, iana-etc).
 //
 // Once assembled the image structure uses a sorted representation of
 // the name. This is to avoid unnecessarily cache-busting images if
@@ -95,6 +95,7 @@ type BuildResult struct {
 func ImageFromName(name string, tag string) Image {
 	pkgs := strings.Split(name, "/")
 	expanded := convenienceNames(pkgs)
+	expanded = append(expanded, "cacert", "iana-etc")
 
 	sort.Strings(pkgs)
 	sort.Strings(expanded)
@@ -131,7 +132,7 @@ type ImageResult struct {
 //
 // * `shell`: Includes bash, coreutils and other common command-line tools
 func convenienceNames(packages []string) []string {
-	shellPackages := []string{"bashInteractive", "cacert", "coreutils", "iana-etc", "moreutils", "nano"}
+	shellPackages := []string{"bashInteractive", "coreutils", "moreutils", "nano"}
 
 	if packages[0] == "shell" {
 		return append(packages[1:], shellPackages...)