Skip to content

Commit 3c11789

Browse files
committed
feat: enable openssh for hp-laptop
Signed-off-by: Reputable2722 <153411261+Reputable2772@users.noreply.github.com>
1 parent f2e2d7a commit 3c11789

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

Config/config.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,14 @@ rec {
5959
};
6060
};
6161

62-
hp-laptop = {
62+
hp-laptop = rec {
6363
secrets = {
6464
encryption = {
6565
pkeyfile = "/etc/ssh/HP-Encryption";
6666
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO9rLYwb+3DofPSPGlif3FvrIb2V/ujfn3u7d/YmfU7s";
6767
};
6868
};
69+
openssh = secrets.encryption;
6970
};
7071

7172
rescue = { };

System/HP-Laptop/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
./hardware-configuration.nix
66
./lanzaboote.nix
77
./networking.nix
8+
./openssh.nix
89
./users.nix
910
];
1011
}

System/HP-Laptop/openssh.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
services.openssh = {
3+
enable = true;
4+
ports = [ 2222 ];
5+
settings = {
6+
PasswordAuthentication = false;
7+
KbdInteractiveAuthentication = false;
8+
PermitRootLogin = "no";
9+
PubkeyAuthentication = true;
10+
};
11+
};
12+
}

System/HP-Laptop/users.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# shell = pkgs.zsh;
3131
hashedPasswordFile = config.age.secrets.selfhostedPassword.path;
3232
linger = true;
33+
openssh.authorizedKeys.keys = config'.system.${config.networking.hostName}.openssh;
3334
};
3435

3536
users.users.vishnu = {

0 commit comments

Comments
 (0)