mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-29 06:45:54 +03:00
nixos/dockerRegistry: add package option
This allows the module user to select an alternative container registry package such as `pkgs.gitlab-container-registry` for GitLab users.
This commit is contained in:
parent
82d9c2e91f
commit
049d680510
@ -49,6 +49,14 @@ in {
|
||||
options.services.dockerRegistry = {
|
||||
enable = mkEnableOption (lib.mdDoc "Docker Registry");
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = mdDoc "Which Docker registry package to use.";
|
||||
default = pkgs.docker-distribution;
|
||||
defaultText = literalExpression "pkgs.docker-distribution";
|
||||
example = literalExpression "pkgs.gitlab-container-registry";
|
||||
};
|
||||
|
||||
listenAddress = mkOption {
|
||||
description = lib.mdDoc "Docker registry host or ip to bind to.";
|
||||
default = "127.0.0.1";
|
||||
@ -117,7 +125,7 @@ in {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
script = ''
|
||||
${pkgs.docker-distribution}/bin/registry serve ${configFile}
|
||||
${cfg.package}/bin/registry serve ${configFile}
|
||||
'';
|
||||
|
||||
serviceConfig = {
|
||||
@ -136,7 +144,7 @@ in {
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
script = ''
|
||||
${pkgs.docker-distribution}/bin/registry garbage-collect ${configFile}
|
||||
${cfg.package}/bin/registry garbage-collect ${configFile}
|
||||
/run/current-system/systemd/bin/systemctl restart docker-registry.service
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user