mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
62 lines
1.6 KiB
Nix
62 lines
1.6 KiB
Nix
{ lib, pkgs, config, inputs, ... }: {
|
|
|
|
imports = [
|
|
../common
|
|
../common/mnt-public.nix
|
|
inputs.nixos-wsl.nixosModules.wsl
|
|
];
|
|
|
|
# system.stateVersion = "22.11";
|
|
nixpkgs.hostPlatform.system = "x86_64-linux";
|
|
|
|
wsl = {
|
|
enable = true;
|
|
wslConf.automount.root = "/mnt";
|
|
defaultUser = "sstent";
|
|
startMenuLaunchers = true;
|
|
interop.preserveArgvZero = true;
|
|
nativeSystemd = true;
|
|
# Enable native Docker support
|
|
docker-native.enable = true;
|
|
# Enable integration with Docker Desktop (needs to be installed)
|
|
# docker-desktop.enable = true;
|
|
};
|
|
|
|
environment.systemPackages = [
|
|
pkgs.socat
|
|
pkgs.npiperelay
|
|
#pkgs.wsl-ssh-agent-relay
|
|
];
|
|
|
|
# nixpkgs.config.packageOverrides = pkgs:
|
|
# with pkgs; rec {
|
|
# npiperelay = callPackage ../../pkgs/npiperelay { };
|
|
# #wsl-ssh-agent-relay = callPackage ../../pkgs/wsl-ssh-agent-relay { };
|
|
# };
|
|
|
|
systemd.services.nixs-wsl-systemd-fix = {
|
|
description = "Fix the /dev/shm symlink to be a mount";
|
|
unitConfig = {
|
|
DefaultDependencies = "no";
|
|
Before = [
|
|
"sysinit.target"
|
|
"systemd-tmpfiles-setup-dev.service"
|
|
"systemd-tmpfiles-setup.service"
|
|
"systemd-sysctl.service"
|
|
];
|
|
ConditionPathExists = "/dev/shm";
|
|
ConditionPathIsSymbolicLink = "/dev/shm";
|
|
ConditionPathIsMountPoint = "/run/shm";
|
|
};
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = [
|
|
"${pkgs.coreutils-full}/bin/rm /dev/shm"
|
|
"/run/wrappers/bin/mount --bind -o X-mount.mkdir /run/shm /dev/shm"
|
|
];
|
|
};
|
|
wantedBy = [ "sysinit.target" ];
|
|
};
|
|
|
|
}
|