Add module to configure sshd

This commit is contained in:
Pim Kunis 2024-11-09 16:54:33 +01:00
parent 14e269c02c
commit 59b58faeb5
4 changed files with 50 additions and 5 deletions

View file

@ -1,4 +1,8 @@
{lib, ...}: {
{
config,
lib,
...
}: {
config = {
pim = {
cinnamon.enable = true;
@ -6,8 +10,15 @@
facter.reportPath = ./facter.json;
networking.hostName = "gamepc";
users.users.pim.password = "";
users.users.root.password = "";
services.openssh.enable = true;
users.users = {
root.password = "";
pim = {
openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
password = "";
};
};
boot.loader.grub = {
enable = true;

View file

@ -1,6 +1,12 @@
{lib, ...}: {
{
config,
lib,
...
}: let
cfg = config.pim.cinnamon;
in {
options.pim.cinnamon.enable = lib.mkEnableOption "cinnamon";
config = {
config = lib.mkIf cfg.enable {
services = {
displayManager.defaultSession = "cinnamon";
libinput.enable = true;

View file

@ -20,6 +20,7 @@
./tailscale.nix
./compliance.nix
./cinnamon.nix
./ssh.nix
];
time.timeZone = "Europe/Amsterdam";

27
nixos/ssh.nix Normal file
View file

@ -0,0 +1,27 @@
{lib, ...}: {
options = {
pim.ssh.keys = lib.mkOption {
type = lib.types.attrsOf (lib.types.listOf lib.types.str);
};
};
config = {
pim.ssh.keys = {
pim = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOodpLr+FDRyKyHjucHizNLVFHZ5AQmE9GmxMnOsSoaw pimkunis@thinkpadpim"];
niels = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINUZp4BCxf7uLa1QWonx/Crf8tYZ5MKIZ+EuaBa82LrV user@user-laptop"];
};
services = {
openssh = {
openFirewall = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
GSSAPIAuthentication = false;
UseDns = false;
};
};
};
};
}