mirror of
https://github.com/kmein/niveum
synced 2026-03-20 03:51:07 +01:00
feat: automate entering ssh passphrase
This commit is contained in:
2
ci.nix
2
ci.nix
@@ -56,7 +56,7 @@
|
|||||||
"spotify/password"
|
"spotify/password"
|
||||||
];
|
];
|
||||||
systemSecrets = let
|
systemSecrets = let
|
||||||
basic = ["retiolum.ed25519" "retiolum.key" "syncthing/cert.pem" "syncthing/key.pem"];
|
basic = ["retiolum.ed25519" "retiolum.key" "syncthing/cert.pem" "syncthing/key.pem" "ssh/passphrase"];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
|
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
|
||||||
|
|||||||
@@ -7,8 +7,16 @@
|
|||||||
inherit (import <niveum/lib>) sshPort kieran;
|
inherit (import <niveum/lib>) sshPort kieran;
|
||||||
externalNetwork = import <niveum/lib/external-network.nix>;
|
externalNetwork = import <niveum/lib/external-network.nix>;
|
||||||
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
||||||
|
ssh-passphrase = lib.strings.fileContents <system-secrets/ssh/passphrase>;
|
||||||
in {
|
in {
|
||||||
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add";
|
services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
|
||||||
|
#!${pkgs.expect}/bin/expect -f
|
||||||
|
spawn ${pkgs.openssh}/bin/ssh-add
|
||||||
|
expect "Enter passphrase for *:"
|
||||||
|
send "${ssh-passphrase}\n";
|
||||||
|
expect "Identity added: *"
|
||||||
|
interact
|
||||||
|
'');
|
||||||
|
|
||||||
programs.ssh.startAgent = true;
|
programs.ssh.startAgent = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user