From d90c7dc326e3ed271141533dcdb65df31dcb04db Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 31 May 2022 23:53:03 +0200 Subject: [PATCH] project.name: nullOr str -> str --- CHANGELOG.md | 1 + docs/modules/ROOT/partials/NixOSOptions.adoc | 11 ++++------- examples/full-nixos/arion-compose.nix | 1 + examples/nixos-unit/arion-compose.nix | 1 + examples/traefik/arion-compose.nix | 2 +- src/haskell/testdata/Arion/NixSpec/arion-compose.json | 2 +- src/haskell/testdata/Arion/NixSpec/arion-compose.nix | 1 + src/nix/modules/composition/composition.nix | 5 +++-- 8 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 155cb7a..f616304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Changed * Healthcheck-based dependencies in `service.depends_on`. +* The `project.name` option is now mandatory. ### Added diff --git a/docs/modules/ROOT/partials/NixOSOptions.adoc b/docs/modules/ROOT/partials/NixOSOptions.adoc index 690b23b..eb34a3d 100644 --- a/docs/modules/ROOT/partials/NixOSOptions.adoc +++ b/docs/modules/ROOT/partials/NixOSOptions.adoc @@ -112,17 +112,14 @@ Name of the project. See link:https://docs.docker.com/compose/reference/envvars/#compose_project_name[COMPOSE_PROJECT_NAME] +This is not optional, because getting the project name from a directory name tends to produce different results for different repo checkout location names. + [discrete] === details -Type:: null or string -Default:: -+ ----- -null ----- - +Type:: string +No Default:: {blank} No Example:: {blank} diff --git a/examples/full-nixos/arion-compose.nix b/examples/full-nixos/arion-compose.nix index 1524e3a..94890db 100644 --- a/examples/full-nixos/arion-compose.nix +++ b/examples/full-nixos/arion-compose.nix @@ -1,4 +1,5 @@ { + project.name = "full-nixos"; services.webserver = { pkgs, lib, ... }: { nixos.useSystemd = true; nixos.configuration.boot.tmpOnTmpfs = true; diff --git a/examples/nixos-unit/arion-compose.nix b/examples/nixos-unit/arion-compose.nix index 1edd4e5..642a18e 100644 --- a/examples/nixos-unit/arion-compose.nix +++ b/examples/nixos-unit/arion-compose.nix @@ -17,6 +17,7 @@ */ { + project.name = "nixos-unit"; services.webserver = { config, pkgs, ... }: { nixos.configuration = {config, lib, options, pkgs, ...}: { diff --git a/examples/traefik/arion-compose.nix b/examples/traefik/arion-compose.nix index b6c6f7d..c43627f 100644 --- a/examples/traefik/arion-compose.nix +++ b/examples/traefik/arion-compose.nix @@ -9,7 +9,7 @@ */ { lib, pkgs, ... }: { - + config.project.name = "traefik"; config.services = { traefik = { image.command = [ diff --git a/src/haskell/testdata/Arion/NixSpec/arion-compose.json b/src/haskell/testdata/Arion/NixSpec/arion-compose.json index 972db6f..c26d994 100644 --- a/src/haskell/testdata/Arion/NixSpec/arion-compose.json +++ b/src/haskell/testdata/Arion/NixSpec/arion-compose.json @@ -37,7 +37,7 @@ } ], "project": { - "name": null + "name": "unit-test-data" }, "serviceInfo": { "webserver": { diff --git a/src/haskell/testdata/Arion/NixSpec/arion-compose.nix b/src/haskell/testdata/Arion/NixSpec/arion-compose.nix index dac420d..40c5907 100644 --- a/src/haskell/testdata/Arion/NixSpec/arion-compose.nix +++ b/src/haskell/testdata/Arion/NixSpec/arion-compose.nix @@ -1,4 +1,5 @@ { + project.name = "unit-test-data"; services.webserver = { pkgs, ... }: { nixos.useSystemd = true; nixos.configuration.boot.tmpOnTmpfs = true; diff --git a/src/nix/modules/composition/composition.nix b/src/nix/modules/composition/composition.nix index 37d2854..8b53882 100644 --- a/src/nix/modules/composition/composition.nix +++ b/src/nix/modules/composition/composition.nix @@ -16,9 +16,10 @@ in Name of the project. See ${link "https://docs.docker.com/compose/reference/envvars/#compose_project_name" "COMPOSE_PROJECT_NAME"} + + This is not optional, because getting the project name from a directory name tends to produce different results for different repo checkout location names. ''; - type = types.nullOr types.str; - default = null; + type = types.str; }; }; config = {