From d5851d56761da0750ade90bc4a693d414671b045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 5 Apr 2024 13:27:22 +0200 Subject: [PATCH] nixos/dockerRegistry: add `configFile` option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit defaultText based on how nixos/modules/services/development/athens.nix does it. Signed-off-by: Christina Sørensen --- nixos/modules/services/misc/docker-registry.nix | 14 ++++++++++++-- nixos/tests/docker-registry.nix | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/misc/docker-registry.nix b/nixos/modules/services/misc/docker-registry.nix index a2764abd993e..93bf71ea3ecc 100644 --- a/nixos/modules/services/misc/docker-registry.nix +++ b/nixos/modules/services/misc/docker-registry.nix @@ -41,8 +41,7 @@ let }; }; - configFile = pkgs.writeText "docker-registry-config.yml" (builtins.toJSON (recursiveUpdate registryConfig cfg.extraConfig)); - + configFile = cfg.configFile; in { options.services.dockerRegistry = { enable = mkEnableOption "Docker Registry"; @@ -106,6 +105,17 @@ in { type = types.attrs; }; + configFile = lib.mkOption { + default = pkgs.writeText "docker-registry-config.yml" (builtins.toJSON (recursiveUpdate registryConfig cfg.extraConfig)); + defaultText = literalExpression ''pkgs.writeText "docker-registry-config.yml" "# my custom docker-registry-config.yml ..."''; + description = '' + Path to CNCF distribution config file. + + Setting this option will override any configuration applied by the extraConfig option. + ''; + type = types.path; + }; + enableGarbageCollect = mkEnableOption "garbage collect"; garbageCollectDates = mkOption { diff --git a/nixos/tests/docker-registry.nix b/nixos/tests/docker-registry.nix index 3969ef3f0226..4f033fc30b19 100644 --- a/nixos/tests/docker-registry.nix +++ b/nixos/tests/docker-registry.nix @@ -3,7 +3,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { name = "docker-registry"; meta = with pkgs.lib.maintainers; { - maintainers = [ globin ironpinguin ]; + maintainers = [ globin ironpinguin cafkafk ]; }; nodes = {