This commit is contained in:
2025-10-30 16:43:31 +09:00
parent 5f53810dad
commit e20e27bd7a
6 changed files with 40 additions and 2 deletions
+1
View File
@@ -10,6 +10,7 @@
./network.nix
./packages.nix
./services.nix
./ssh.nix
./system.nix
./user.nix
./xserver.nix
+16
View File
@@ -0,0 +1,16 @@
{ inputs, pkgs, ... }:
{
imports = [ inputs.auth-keys-hub.nixosModules.auth-keys-hub ];
services.openssh = {
enable = true;
openFirewall = true;
};
programs.auth-keys-hub = {
enable = true;
github = {
users = [ "moons-14:moons" ];
};
};
}
+2
View File
@@ -3,5 +3,7 @@
imports = [
./git.nix
./fcitx5
./ssh.nix
./zsh.nix
];
}
+19
View File
@@ -0,0 +1,19 @@
{ config, lib, ... }:
{
programs.ssh.startAgent = true;
home.packages = [ pkgs.openssh ];
home.activation.generateSshKey = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
key="$HOME/.ssh/id_ed25519"
if [ ! -f "$key" ]; then
umask 077
mkdir -p "$HOME/.ssh"
ssh-keygen -t ed25519 -N "" -f "$key" \
-C "${config.home.username}@$(hostnamectl --static)"
echo "Generated SSH key at $key"
echo "Public key:"
cat "$key.pub"
fi
'';
}