mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 12:29:19 -08:00
Refactors, konawall-py for darwin, sumireko update to Sonoma
This commit is contained in:
parent
091ddb5b91
commit
bc61d82487
151 changed files with 691 additions and 792 deletions
|
|
@ -4,9 +4,8 @@ _: let
|
|||
tree,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.modules) mkForce;
|
||||
}: let
|
||||
inherit (lib.modules) mkForce;
|
||||
in {
|
||||
imports = with tree; [
|
||||
inputs.wsl.nixosModules.wsl
|
||||
|
|
@ -76,61 +75,61 @@ _: let
|
|||
services.gpg-agent.enable = false;
|
||||
programs.git.signing.gpgPath = "/mnt/c/Program Files (x86)/GnuPG/bin/gpg.exe";
|
||||
programs.zsh.profileExtra = ''
|
||||
if [[ -n "$XDG_SESSION_ID" && "$TERM" == "dumb" &&
|
||||
"$(ps -p $PPID -o comm=)" == "login" ]]; then
|
||||
# Running in the background login process. Do nothing.
|
||||
return
|
||||
fi
|
||||
gpg-connect-agent killagent /bye &> /dev/null
|
||||
WIN_USER="kat"
|
||||
SSH_DIR="''${HOME}/.ssh" #
|
||||
mkdir -p "''${SSH_DIR}"
|
||||
wsl2_ssh_pageant_bin="''${SSH_DIR}/wsl2-ssh-pageant.exe"
|
||||
ln -sf "/mnt/c/Users/''${WIN_USER}/.ssh/wsl2-ssh-pageant.exe" "''${wsl2_ssh_pageant_bin}"
|
||||
if [[ -n "$XDG_SESSION_ID" && "$TERM" == "dumb" &&
|
||||
"$(ps -p $PPID -o comm=)" == "login" ]]; then
|
||||
# Running in the background login process. Do nothing.
|
||||
return
|
||||
fi
|
||||
gpg-connect-agent killagent /bye &> /dev/null
|
||||
WIN_USER="kat"
|
||||
SSH_DIR="''${HOME}/.ssh" #
|
||||
mkdir -p "''${SSH_DIR}"
|
||||
wsl2_ssh_pageant_bin="''${SSH_DIR}/wsl2-ssh-pageant.exe"
|
||||
ln -sf "/mnt/c/Users/''${WIN_USER}/.ssh/wsl2-ssh-pageant.exe" "''${wsl2_ssh_pageant_bin}"
|
||||
|
||||
listen_socket() {
|
||||
sock_path="$1" && shift
|
||||
fork_args="''${sock_path},fork"
|
||||
exec_args="''${wsl2_ssh_pageant_bin} $@"
|
||||
listen_socket() {
|
||||
sock_path="$1" && shift
|
||||
fork_args="''${sock_path},fork"
|
||||
exec_args="''${wsl2_ssh_pageant_bin} $@"
|
||||
|
||||
if ! ps x | grep -v grep | grep -q "''${fork_args}"; then
|
||||
rm -f "''${sock_path}"
|
||||
(setsid nohup socat "UNIX-LISTEN:''${fork_args}" "EXEC:''${exec_args}" &>/dev/null &)
|
||||
fi
|
||||
}
|
||||
if ! ps x | grep -v grep | grep -q "''${fork_args}"; then
|
||||
rm -f "''${sock_path}"
|
||||
(setsid nohup socat "UNIX-LISTEN:''${fork_args}" "EXEC:''${exec_args}" &>/dev/null &)
|
||||
fi
|
||||
}
|
||||
|
||||
# SSH
|
||||
export SSH_AUTH_SOCK="''${SSH_DIR}/agent.sock"
|
||||
listen_socket "''${SSH_AUTH_SOCK}"
|
||||
# SSH
|
||||
export SSH_AUTH_SOCK="''${SSH_DIR}/agent.sock"
|
||||
listen_socket "''${SSH_AUTH_SOCK}"
|
||||
|
||||
# GPG
|
||||
export GPG_AGENT_SOCK="''$(gpgconf --list-dirs socketdir)/S.gpg-agent"
|
||||
# GPG
|
||||
export GPG_AGENT_SOCK="''$(gpgconf --list-dirs socketdir)/S.gpg-agent"
|
||||
|
||||
if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then
|
||||
echo "1"
|
||||
rm -rf "$GPG_AGENT_SOCK"
|
||||
if test -x "$wsl2_ssh_pageant_bin"; then
|
||||
(setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin -gpg S.gpg-agent" >/dev/null 2>&1 &)
|
||||
else
|
||||
echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable."
|
||||
fi
|
||||
fi
|
||||
export GPG_AGENT_SOCK="/home/kat/.gnupg/S.gpg-agent"
|
||||
if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then
|
||||
echo "1"
|
||||
rm -rf "$GPG_AGENT_SOCK"
|
||||
if test -x "$wsl2_ssh_pageant_bin"; then
|
||||
(setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin -gpg S.gpg-agent" >/dev/null 2>&1 &)
|
||||
else
|
||||
echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable."
|
||||
fi
|
||||
fi
|
||||
export GPG_AGENT_SOCK="/home/kat/.gnupg/S.gpg-agent"
|
||||
|
||||
if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then
|
||||
echo "1"
|
||||
rm -rf "$GPG_AGENT_SOCK"
|
||||
if test -x "$wsl2_ssh_pageant_bin"; then
|
||||
(setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin -gpg S.gpg-agent" >/dev/null 2>&1 &)
|
||||
else
|
||||
echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable."
|
||||
fi
|
||||
fi
|
||||
unset wsl2_ssh_pageant_bin
|
||||
if ! ss -a | grep -q "$GPG_AGENT_SOCK"; then
|
||||
echo "1"
|
||||
rm -rf "$GPG_AGENT_SOCK"
|
||||
if test -x "$wsl2_ssh_pageant_bin"; then
|
||||
(setsid nohup socat UNIX-LISTEN:"$GPG_AGENT_SOCK,fork" EXEC:"$wsl2_ssh_pageant_bin -gpg S.gpg-agent" >/dev/null 2>&1 &)
|
||||
else
|
||||
echo >&2 "WARNING: $wsl2_ssh_pageant_bin is not executable."
|
||||
fi
|
||||
fi
|
||||
unset wsl2_ssh_pageant_bin
|
||||
'';
|
||||
};
|
||||
|
||||
programs.gnupg.agent.pinentryFlavor = mkForce "curses";
|
||||
programs.gnupg.agent.pinentryFlavor = mkForce "curses";
|
||||
|
||||
networking = {
|
||||
hostId = "dddbb888";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue