wsl: add systemd startup workaround

This commit is contained in:
NullBite 2024-06-01 04:31:23 +00:00
parent ee80eb4ff6
commit 2c3c68aea5
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -1,4 +1,4 @@
{ pkgs, config, lib, ... }:
{ pkgs, config, lib, vars, ... }:
{
config = {
networking.hostName = "nixos-wsl";
@ -9,6 +9,27 @@
};
wsl.interop.register = true;
users.users.${vars.username}.linger = true;
systemd.services = let
user = config.users.users.${vars.username};
mainUid = builtins.toString user.uid;
in {
# "user@${mainUid}" = {
# wantedBy = [ "multi-user.target" ];
# overrideStrategy = "asDropin";
# };
workaround-reisolate = {
serviceConfig = {
ExecStartPre = "${pkgs.coreutils}/bin/sleep 10";
ExecStart = "${pkgs.systemd}/bin/systemctl isolate --no-block default.target";
Type = "oneshot";
RemainAfterExit = true;
};
description = "WSL startup workaround";
wantedBy = [ "default.target" ];
};
};
networking.networkmanager.enable = false;
programs.gnupg.agent = {
enable = true;