fixup! fix(openssh): Actually set pub keys from github

This commit is contained in:
Jalil David Salamé Messina 2024-01-31 18:06:40 +01:00
parent ffcbac2a73
commit 65a30b5283
Signed by: jalil
GPG key ID: F016B9E770737A0B

View file

@ -1,6 +1,18 @@
{ stylix }: { config, pkgs, lib, ... }:
let
cfg = config.jconfig;
keysFromGithub = lib.attrsets.mapAttrs'
(username: sha256: {
name = "pubkeys/${username}";
value = {
mode = "0755";
source = builtins.fetchurl {
inherit sha256;
url = "https://github.com/${username}.keys";
};
};
})
cfg.importSSHKeysFromGithub;
in
{
imports = [
@ -49,13 +61,8 @@ in
sudo.disabled = false;
};
services.openssh.authorizedKeysFiles =
lib.mapAttrsToList
(username: sha256: builtins.fetchurl {
inherit sha256;
url = "https://github.com/${username}.keys";
})
cfg.importSSHKeysFromGithub;
environment.etc = keysFromGithub;
services.openssh.authorizedKeysFiles = builtins.map (path: "/etc/${path}") (builtins.attrNames keysFromGithub);
# Default shell
programs.zsh.enable = true;