mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
docker: Allow package selection in module
This commit is contained in:
parent
11cd027b30
commit
2bb57ef776
@ -126,14 +126,23 @@ in
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
package = mkOption {
|
||||
default = pkgs.docker;
|
||||
type = types.package;
|
||||
example = pkgs.docker-edge;
|
||||
description = ''
|
||||
Docker package to be used in the module.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [{
|
||||
environment.systemPackages = [ pkgs.docker ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
users.extraGroups.docker.gid = config.ids.gids.docker;
|
||||
systemd.packages = [ pkgs.docker ];
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
systemd.services.docker = {
|
||||
wantedBy = optional cfg.enableOnBoot "multi-user.target";
|
||||
@ -142,7 +151,7 @@ in
|
||||
ExecStart = [
|
||||
""
|
||||
''
|
||||
${pkgs.docker}/bin/dockerd \
|
||||
${cfg.package}/bin/dockerd \
|
||||
--group=docker \
|
||||
--host=fd:// \
|
||||
--log-driver=${cfg.logDriver} \
|
||||
@ -180,7 +189,7 @@ in
|
||||
serviceConfig.Type = "oneshot";
|
||||
|
||||
script = ''
|
||||
${pkgs.docker}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
|
||||
${cfg.package}/bin/docker system prune -f ${toString cfg.autoPrune.flags}
|
||||
'';
|
||||
|
||||
startAt = optional cfg.autoPrune.enable cfg.autoPrune.dates;
|
||||
|
Loading…
Reference in New Issue
Block a user