make it a shell instead of ssh

I had issues with the network but than didn't bothered further because
the terminal access was good enough.
This commit is contained in:
Jörg Thalheim 2024-07-12 00:12:49 +02:00 committed by Jörg Thalheim
parent 6a82a99399
commit ab6e716617
4 changed files with 5 additions and 23 deletions

View file

@ -161,7 +161,7 @@
github-org-backup = ./modules/nixos/github-org-backup.nix;
hercules-ci = ./modules/nixos/hercules-ci.nix;
hydra = ./modules/nixos/hydra.nix;
initrd-ssh = ./modules/nixos/initrd-ssh.nix;
emergency-access = ./modules/nixos/emergency-access.nix;
monitoring = ./modules/nixos/monitoring;
nur-update = ./modules/nixos/nur-update.nix;
remote-builder = ./modules/nixos/remote-builder.nix;

View file

@ -9,7 +9,6 @@
inputs.self.nixosModules.common
inputs.self.nixosModules.builder
inputs.self.nixosModules.disko-zfs
inputs.self.nixosModules.initrd-ssh
];
nixCommunity.gc.gbFree = 500;

View file

@ -0,0 +1,4 @@
{
# allow to access emergency shell with a password
boot.initrd.systemd.emergencyAccess = "$6$he2fblfl/H7I.kvz$WbSCMXu8ztmqfj5jG4czqvu/rkMHxufxqHgy1urzXFSN.jZB4QiW5lOjR08vk8pZTyim3TT1wFkMaNE9zZ3sc1";
}

View file

@ -1,21 +0,0 @@
{ config, ... }:
let
admins = builtins.filter (user: builtins.elem "wheel" user.extraGroups) (builtins.attrValues config.users.users);
in
{
boot.initrd.systemd.network.networks."10-uplink" = config.systemd.network.networks."10-uplink";
boot.initrd.network = {
enable = true;
ssh = {
enable = true;
port = 2222;
# fixme, how can we provide this file on the first installation?
hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
};
boot.initrd.kernelModules = [ "igb" ]; # fixme, this depends on the kernel version
boot.initrd.network.ssh.authorizedKeyFiles = builtins.concatMap (user: user.openssh.authorizedKeys.keyFiles) admins;
boot.initrd.systemd.emergencyAccess = "$6$he2fblfl/H7I.kvz$WbSCMXu8ztmqfj5jG4czqvu/rkMHxufxqHgy1urzXFSN.jZB4QiW5lOjR08vk8pZTyim3TT1wFkMaNE9zZ3sc1";
}