Rename fake modules to modules-old
This commit is contained in:
parent
82a2d7bbea
commit
97db5d05d3
28 changed files with 13 additions and 13 deletions
41
nixos/modules-old/utils/ssh/README.md
Normal file
41
nixos/modules-old/utils/ssh/README.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Adding SSH keys
|
||||
|
||||
To incorporate SSH keys, for instance, to enable authentication with a Git server, follow these steps:
|
||||
|
||||
Step 0: If necessary, generate a keypair, for example using the command:
|
||||
|
||||
```bash
|
||||
ssh-keygen -t ed25519
|
||||
```
|
||||
|
||||
Please note that setting a password for the keypair is not yet tested.
|
||||
|
||||
Step 1: Create a new file named `yourservice.yaml` within the [secrets](../../../secrets/) directory by executing the following command:
|
||||
|
||||
```bash
|
||||
sops secrets/yourservice.yaml
|
||||
```
|
||||
|
||||
Within this file, create a value that contains your private key. For example:
|
||||
|
||||
```yaml
|
||||
yourservice:
|
||||
ssh: |
|
||||
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||
<...>
|
||||
-----END OPENSSH PRIVATE KEY-----
|
||||
```
|
||||
|
||||
Step 2: Reference this value in [your sops configuration](../../utils/sops/default.nix) as follows:
|
||||
|
||||
```
|
||||
sops.secrets."yourservice/ssh".format = "yaml";
|
||||
sops.secrets."yourservice/sss".sopsFile = secrets/youservice.yaml;
|
||||
```
|
||||
|
||||
Step 3: Finally, add the SSH key to your SSH configuration so that it is used correctly when connecting to your host. Add the following lines to your SSH configuraton file:
|
||||
|
||||
```
|
||||
Host yourservice
|
||||
IdentityFile /run/secrets/yourservice/ssh
|
||||
```
|
54
nixos/modules-old/utils/ssh/default.nix
Normal file
54
nixos/modules-old/utils/ssh/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
|
||||
home-manager.users.tdpeuter = {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
matchBlocks = {
|
||||
"Hugo" = {
|
||||
hostname = "192.168.0.11";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/Hugo/ssh";
|
||||
user = "admin";
|
||||
};
|
||||
"HPC" = {
|
||||
hostname = "login.hpc.ugent.be";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/UGent/HPC/ssh";
|
||||
user = "vsc44995";
|
||||
};
|
||||
|
||||
# Git authentication
|
||||
"git.depeuter.dev" = {
|
||||
hostname = "git.depeuter.dev";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/Hugo/Gitea/ssh";
|
||||
user = "git";
|
||||
};
|
||||
"github.com" = {
|
||||
hostname = "github.com";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/GitHub/ssh";
|
||||
user = "git";
|
||||
};
|
||||
"github.ugent.be" = {
|
||||
hostname = "github.ugent.be";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/UGent/GitHub/ssh";
|
||||
user = "git";
|
||||
};
|
||||
"subgit.ugent.be" = {
|
||||
hostname = "subgit.ugent.be";
|
||||
identitiesOnly = true;
|
||||
identityFile = "/run/secrets/UGent/SubGit/ssh";
|
||||
user = "git";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue