Add updated wsl configuration

This commit is contained in:
Dave Gallant
2022-07-30 13:42:28 +00:00
parent e0b6e5782c
commit 328b2a2d95
20 changed files with 3 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}:
with builtins;
with lib; {
options.wsl.docker = with types; {
enable = mkEnableOption "Docker Desktop integration";
};
config = let
cfg = config.wsl.docker;
in
mkIf (config.wsl.enable && cfg.enable) {
environment.systemPackages = with pkgs; [
docker
docker-compose
];
systemd.services.docker-desktop-proxy = {
description = "Docker Desktop proxy";
script = ''
${config.wsl.automountPath}/wsl/docker-desktop/docker-desktop-user-distro proxy --docker-desktop-root ${config.wsl.automountPath}/wsl/docker-desktop
'';
wantedBy = ["multi-user.target"];
serviceConfig = {
Restart = "on-failure";
RestartSec = "30s";
};
};
users.groups.docker.members = [
config.wsl.defaultUser
];
};
}