feat(nixos): Add option to fetch ssh keys from github
This commit is contained in:
parent
7382e8d0f0
commit
9250a92d5a
2 changed files with 22 additions and 0 deletions
|
@ -46,6 +46,15 @@ in
|
||||||
status.disabled = false;
|
status.disabled = false;
|
||||||
sudo.disabled = false;
|
sudo.disabled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.ssh.knownHostsFiles =
|
||||||
|
lib.mapAttrsToList
|
||||||
|
(username: sha256: builtins.fetchurl {
|
||||||
|
inherit sha256;
|
||||||
|
url = "https://github.com/${username}.keys";
|
||||||
|
})
|
||||||
|
cfg.importSSHKeysFromGithub;
|
||||||
|
|
||||||
# Default shell
|
# Default shell
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
users.defaultUserShell = pkgs.zsh;
|
users.defaultUserShell = pkgs.zsh;
|
||||||
|
|
|
@ -56,6 +56,19 @@ let
|
||||||
description = "Jalil's styling options";
|
description = "Jalil's styling options";
|
||||||
type = types.submodule styling;
|
type = types.submodule styling;
|
||||||
};
|
};
|
||||||
|
importSSHKeysFromGithub = lib.mkOption {
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Import public ssh keys from a github username.
|
||||||
|
|
||||||
|
This will fetch the keys from https://github.com/$${username}.keys.
|
||||||
|
|
||||||
|
The format is `"$${github-username}" = $${sha256-hash}`. The example
|
||||||
|
will try to fetch the keys from <https://github.com/jalil-salame.keys>.
|
||||||
|
'';
|
||||||
|
default = { };
|
||||||
|
example = { "jalil-salame" = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; };
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue