Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d828bf7a1078
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2036550a460d
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 23, 2019

  1. nixos/docker-registry: Allow use of non-filesystem storage

    Previously this module precluded use of storage backends other than
    `filesystem`. It is now possible to configure another storage backend
    manually by setting `services.dockerRegistry.storagePath` to `null` and
    configuring the other backend via `extraConfig`.
    bgamari authored and globin committed Mar 23, 2019
    Copy the full SHA
    2036550 View commit details
Showing with 15 additions and 8 deletions.
  1. +15 −8 nixos/modules/services/misc/docker-registry.nix
23 changes: 15 additions & 8 deletions nixos/modules/services/misc/docker-registry.nix
Original file line number Diff line number Diff line change
@@ -14,9 +14,10 @@ let
log.fields.service = "registry";
storage = {
cache.blobdescriptor = blobCache;
filesystem.rootdirectory = cfg.storagePath;
delete.enabled = cfg.enableDelete;
};
} // (if cfg.storagePath != null
then { filesystem.rootdirectory = cfg.storagePath; }
else {});
http = {
addr = "${cfg.listenAddress}:${builtins.toString cfg.port}";
headers.X-Content-Type-Options = ["nosniff"];
@@ -61,9 +62,12 @@ in {
};

storagePath = mkOption {
type = types.path;
type = types.nullOr types.path;
default = "/var/lib/docker-registry";
description = "Docker registry storage path.";
description = ''
Docker registry storage path for the filesystem storage backend. Set to
null to configure another backend via extraConfig.
'';
};

enableDelete = mkOption {
@@ -140,9 +144,12 @@ in {
startAt = optional cfg.enableGarbageCollect cfg.garbageCollectDates;
};

users.users.docker-registry = {
createHome = true;
home = cfg.storagePath;
};
users.users.docker-registry =
if cfg.storagePath != null
then {
createHome = true;
home = cfg.storagePath;
}
else {};
};
}