mirror of
https://github.com/librephoenix/nixos-config
synced 2025-07-06 06:52:13 +05:30
Got my NixOS flake to run under WSL!
This commit is contained in:
parent
e877fd63bc
commit
0a71232a56
18 changed files with 1063 additions and 10 deletions
41
profiles/wsl/nixos-wsl/modules/docker-desktop.nix
Executable file
41
profiles/wsl/nixos-wsl/modules/docker-desktop.nix
Executable file
|
@ -0,0 +1,41 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
with builtins; with lib; {
|
||||
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "wsl" "docker" ] [ "wsl" "docker-desktop" ])
|
||||
];
|
||||
|
||||
options.wsl.docker-desktop = with types; {
|
||||
enable = mkEnableOption "Docker Desktop integration";
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.wsl.docker-desktop;
|
||||
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
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue