diff --git a/metallaxis/modules/ssh.nix b/metallaxis/modules/ssh.nix new file mode 100644 index 0000000..8168dda --- /dev/null +++ b/metallaxis/modules/ssh.nix @@ -0,0 +1,41 @@ +{ config, pkgs, ... }: + +{ + sops.secrets = { + config = { + sopsFile = ../../secrets/ssh.yaml; + path = "${config.home.homeDirectory}/.ssh/config"; + }; + servers_key = { + sopsFile = ../../secrets/ssh.yaml; + path = "${config.home.homeDirectory}/.ssh/servers"; + }; + + gitea_key = { + sopsFile = ../../secrets/ssh.yaml; + path = "${config.home.homeDirectory}/.ssh/gitea"; + }; + + github_key = { + sopsFile = ../../secrets/ssh.yaml; + path = "${config.home.homeDirectory}/.ssh/github"; + }; + }; + + home.file = { + ".ssh/servers.pub" = { + source = ../../secrets/ssh/servers.pub; + onChange = "chmod 644 ${config.home.homeDirectory}/.ssh/servers.pub"; + }; + + ".ssh/gitea.pub" = { + source = ../../secrets/ssh/gitea.pub; + onChange = "chmod 644 ${config.home.homeDirectory}/.ssh/gitea.pub"; + }; + + ".ssh/github.pub" = { + source = ../../secrets/ssh/github.pub; + onChange = "chmod 644 ${config.home.homeDirectory}/.ssh/github.pub"; + }; + }; +}