git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #7547 from offlinehacker/nixos/docker-registry/fixes

nixos/docker-registry: docker independant docker registry

commit509afe860b0c1ad18cdd29f3e060fb5769780308 authorJaka Hudoklin <jakahudoklin@gmail.com> dateMon 8 Jun 2015, 12:15 (11 years ago) parent790094ab7cb042
1 file changed+7−8
nixos/modules/services/misc/docker-registry.nix+7−8
nixos/modules/services/misc/docker-registry.nix+7−8
@@ -29,7 +29,7 @@ in {
2929
3030 storagePath = mkOption {
3131 type = types.path;
32− default = "/var/lib/docker/registry";
32+ default = "/var/lib/docker-registry";
3333 description = "Docker registry storage path.";
3434 };
3535
@@ -61,14 +61,9 @@ in {
6161 User = "docker-registry";
6262 Group = "docker";
6363 PermissionsStartOnly = true;
64+ WorkingDirectory = cfg.storagePath;
6465 };
6566
66− preStart = ''
67− mkdir -p ${cfg.storagePath}
68− if [ "$(id -u)" = 0 ]; then
69− chown -R docker-registry:docker ${cfg.storagePath}
70− fi
71− '';
7267 postStart = ''
7368 until ${pkgs.curl}/bin/curl -s -o /dev/null 'http://${cfg.host}:${toString cfg.port}/'; do
7469 sleep 1;
@@ -77,6 +72,10 @@ in {
7772 };
7873
7974 users.extraGroups.docker.gid = mkDefault config.ids.gids.docker;
80− users.extraUsers.docker-registry.uid = config.ids.uids.docker-registry;
75+ users.extraUsers.docker-registry = {
76+ createHome = true;
77+ home = cfg.storagePath;
78+ uid = config.ids.uids.docker-registry;
79+ };
8180 };
8281}