From 65a30b5283ddd30bd04c1e2d3f1301379260841d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 31 Jan 2024 18:06:40 +0100 Subject: [PATCH] fixup! fix(openssh): Actually set pub keys from github --- nixos/default.nix | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/nixos/default.nix b/nixos/default.nix index 16c66ea..793d278 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -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;