mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 18:24:09 +09:00
git
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
./network.nix
|
||||
./packages.nix
|
||||
./services.nix
|
||||
./ssh.nix
|
||||
./system.nix
|
||||
./user.nix
|
||||
./xserver.nix
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,5 +3,7 @@
|
||||
imports = [
|
||||
./git.nix
|
||||
./fcitx5
|
||||
./ssh.nix
|
||||
./zsh.nix
|
||||
];
|
||||
}
|
||||
@@ -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
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user