Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker Desktop integration #545

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions modules/docker-desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ with builtins; with lib; {
mkIf (config.wsl.enable && cfg.enable) {

environment.systemPackages = with pkgs; [
docker
docker-compose
# Compose links to Docker Desktop by opening 'docker-desktop://' URLs
# through xdg-open.
xdg-utils
];

systemd.services.docker-desktop-proxy = {
description = "Docker Desktop proxy";
script = ''
${config.wsl.wslConf.automount.root}/wsl/docker-desktop/docker-desktop-user-distro proxy --docker-desktop-root ${config.wsl.wslConf.automount.root}/wsl/docker-desktop
'';
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "on-failure";
RestartSec = "30s";
};
};
wsl.extraBin = with pkgs; [
# Required unconditionally to check that the WSL environment is conformant.
{ src = "${coreutils}/bin/cat"; }
{ src = "${coreutils}/bin/whoami"; }
# Required to create the 'docker' group and add the WSL user to it.
# This group and its user membership are managed by NixOS below but we
# create those symlinks anyway for robustness.
{ src = "${shadow}/bin/groupadd"; }
{ src = "${shadow}/bin/usermod"; }
];

users.groups.docker.members = [
config.wsl.defaultUser
Expand Down
Loading