feat(ssh): initial ssh config

This commit is contained in:
ooks-io 2024-02-26 22:34:31 +13:00
parent 62150d615f
commit 8fcda1a7e9
7 changed files with 38 additions and 5 deletions

View file

@ -14,6 +14,7 @@
./pipewire.nix
./security.nix
./services
./ssh.nix
];

View file

@ -13,10 +13,6 @@ in
networking.firewall.allowedTCPPorts = [57621]; # Spotify
services = {
openssh = {
enable = true;
settings.UseDns = true;
};
resolved.enable = true;
};

32
system/modules/ssh.nix Normal file
View file

@ -0,0 +1,32 @@
{ lib, config, ... }:
let
cfg = config.systemModules.openssh;
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk";
in
{
options.systemModules = {
openssh = {
enable = lib.mkEnableOption "enable openssh system module";
};
};
config = lib.mkIf cfg.enable {
environment.sessionVariables.SSH_AUTH_SOCK = "~/.1password/agent.sock";
users.users.ooks.openssh.authorizedKeys.keys = [ key ];
services.openssh = {
enable = true;
settings = {
UseDns = true;
PasswordAuthentication = false;
PermitRootLogin = "no";
StreamLocalBindUnlink = "yes";
};
};
};
}

View file

@ -21,6 +21,7 @@ in
bootloader.systemd.enable = true;
programs.gnomeServices.enable = true;
displayManager.tuigreet.enable = true;
openssh.enable = true;
};
environment.systemPackages = [pkgs.git];