Compare commits

...

2 commits

Author SHA1 Message Date
uku
ec679c6dfe
chore(fuji-wsl): remove useless fish init 2025-01-27 20:31:01 +01:00
uku
be8b283139
fix(client): disable ssh-askpass on wsl
the curses askpass is cool but it just. doesn't work well, especially
when there are multiple tabs open in windows terminal which completely
breaks it beyond belief. so yeah, bye bye
2025-01-27 20:27:15 +01:00
5 changed files with 10 additions and 29 deletions

View file

@ -1,4 +1,9 @@
{ lib, pkgs, ... }: {
lib,
pkgs,
config,
...
}:
{ {
imports = [ imports = [
./common.nix ./common.nix
@ -17,7 +22,8 @@
nixd nixd
]; ];
variables.SSH_ASKPASS_REQUIRE = "prefer"; # disable ssh-askpass on wsl namely, to simply have a normal prompt that reads from stdin
variables.SSH_ASKPASS_REQUIRE = if config.programs.ssh.enableAskPassword then "prefer" else "never";
}; };
networking = { networking = {
@ -31,11 +37,7 @@
programs = { programs = {
nix-ld.enable = true; nix-ld.enable = true;
ssh = { ssh.startAgent = true;
startAgent = true;
enableAskPassword = true;
askPassword = lib.mkOverride 1200 "${pkgs.curses-ssh-askpass}"; # see exprs/curses-ssh-askpass.nix
};
}; };
virtualisation.docker.enable = true; virtualisation.docker.enable = true;

View file

@ -112,6 +112,7 @@
programs = { programs = {
firefox.enable = true; firefox.enable = true;
virt-manager.enable = true; virt-manager.enable = true;
ssh.enableAskPassword = true;
}; };
security.pam.services.login.enableGnomeKeyring = true; security.pam.services.login.enableGnomeKeyring = true;

View file

@ -1,15 +0,0 @@
{
lib,
pinentry-curses,
writeShellScript,
}:
writeShellScript "curses-ssh-askpass" ''
if [ -z ''${1+x} ]; then
prompt="GETPIN"
else
prompt="SETDESC $1\nGETPIN"
fi
pin=$(echo -e "$prompt" | ${lib.getExe pinentry-curses} -T /dev/pts/0 | grep D | tr -d '\n')
echo "''${pin:2}"
''

View file

@ -1,6 +1,5 @@
inputs: final: prev: { inputs: final: prev: {
idea-ultimate-fixed = prev.callPackage ./idea-fixed.nix { }; idea-ultimate-fixed = prev.callPackage ./idea-fixed.nix { };
curses-ssh-askpass = prev.callPackage ./curses-ssh-askpass.nix { };
vencord = prev.vencord.overrideAttrs (old: rec { vencord = prev.vencord.overrideAttrs (old: rec {
version = "${old.version}+git.${inputs.vencord.shortRev}"; version = "${old.version}+git.${inputs.vencord.shortRev}";

View file

@ -12,12 +12,6 @@
environment.sessionVariables.LD_LIBRARY_PATH = [ "/run/opengl-driver/lib" ]; environment.sessionVariables.LD_LIBRARY_PATH = [ "/run/opengl-driver/lib" ];
hm.programs.fish.interactiveShellInit = lib.mkAfter ''
if test -f ~/.ssh/id_ed25519
ssh-add -l | grep -q (ssh-keygen -lf ~/.ssh/id_ed25519) || ssh-add ~/.ssh/id_ed25519
end
'';
wsl = { wsl = {
enable = true; enable = true;
defaultUser = "leo"; defaultUser = "leo";