1
0
Fork 0
nix-config/modules/nixos/services/ssh/default.nix
Philipp dc99f3d24d
add spectacle config, add spotify, fix cinny video playback with gstreamer
refactor some stuff to look nicer and have more structure too
2025-04-10 19:19:37 +02:00

37 lines
781 B
Nix

{
lib,
config,
namespace,
...
}:
with lib;
with lib.${namespace};
let
cfg = config.${namespace}.services.ssh;
defaultKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDwUGxdwTgjc61VNh7QNfrrZwz5yHkJ6AGsRsgoDV3a4 mobile"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJqbT8AdnS++ZoL7TYg2skQUvfWx29Iq+mEYv2Ok2QHb arbeit"
];
in
{
options.${namespace}.services.ssh = {
enable = mkBoolOpt false "OpenSSH";
keys = mkOption {
description = "Extra keys to add to config.";
type = lib.types.listOf lib.types.str;
default = defaultKeys;
};
};
config = mkIf cfg.enable {
# Enable the OpenSSH daemon.
services.openssh = enabled;
users.users.philipp.openssh.authorizedKeys = {
inherit (cfg)
keys
;
};
};
}