From 5a0f547441f486715010f77cc697423006fdad77 Mon Sep 17 00:00:00 2001 From: sstent Date: Thu, 23 Feb 2023 10:56:23 -0500 Subject: [PATCH] sync --- hosts/wsl2/default.nix | 49 ++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/hosts/wsl2/default.nix b/hosts/wsl2/default.nix index 4c00c5a..0aa889a 100644 --- a/hosts/wsl2/default.nix +++ b/hosts/wsl2/default.nix @@ -1,5 +1,4 @@ -{ lib, pkgs, config, modulesPath, ... }: -{ +{ lib, pkgs, config, modulesPath, ... }: { # nixpkgs.overlays = overlays; # Enable nix flakes @@ -23,48 +22,46 @@ # docker-desktop.enable = true; }; - mymods = { - user_sstent.enable = true; - }; + mymods = { user_sstent.enable = true; }; sops.defaultSopsFile = ./secrets.yaml; sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; - sops.secrets.example_key = {}; + sops.secrets.example_key = { }; - environment.systemPackages = - [ pkgs.socat - pkgs.npiperelay - #pkgs.wsl-ssh-agent-relay - ]; + environment.systemPackages = [ + pkgs.socat + pkgs.npiperelay + #pkgs.wsl-ssh-agent-relay + ]; - -nixpkgs.config.packageOverrides = pkgs: with pkgs; rec { + nixpkgs.config.packageOverrides = pkgs: + with pkgs; rec { npiperelay = callPackage ../../pkgs/npiperelay { }; #wsl-ssh-agent-relay = callPackage ../../pkgs/wsl-ssh-agent-relay { }; - }; - - - systemd.user.services.ssh-proxy = { - enable = true; - - Unit = { - Description = "WSL Proxy"; }; + + systemd.services.ssh-proxy = { + enable = true; + + Unit = { Description = "WSL Proxy"; }; Service = { ExecStart = "${pkgs.writeShellScript "start-proxy" '' rm -f /tmp/.ssh-sock setsid ${pkgs.socat}/bin/socat UNIX-LISTEN:/tmp/.ssh-sock,fork EXEC:"/mnt/c/ProgramData/chocolatey/bin/npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork ''}"; }; - Install = { - WantedBy = [ "default.target" ]; - }; + Install = { WantedBy = [ "default.target" ]; }; }; - systemd.services.nixs-wsl-systemd-fix = { + 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" ]; + Before = [ + "sysinit.target" + "systemd-tmpfiles-setup-dev.service" + "systemd-tmpfiles-setup.service" + "systemd-sysctl.service" + ]; ConditionPathExists = "/dev/shm"; ConditionPathIsSymbolicLink = "/dev/shm"; ConditionPathIsMountPoint = "/run/shm";