flake/hosts/supernova/default.nix

53 lines
1.5 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, inputs, ... }: with config.lyn.lib; {
imports =
[
./hardware-configuration.nix
./../../users/lyn
];
lyn.kernel.latest.enable = true;
lyn.profiles.base.enable = true;
networking.useDHCP = true;
# Use UEFI
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = [ "ip=dhcp" ];
# Firewall stuff:
networking.firewall.enable = true;
networking.firewall.allowPing = true;
networking.hostName = "supernova";
system.stateVersion = "24.05";
# Firmware updates:
services.fwupd.enable = true;
##############
## Security ##
##############
# Kernel hardening
lyn.kernel.hardened.enable = true;
# Secure boot
lyn.profiles.secureboot.enable = true;
# FDE stuff
2024-10-16 22:19:53 +02:00
boot.loader.timeout = 2;
2024-10-16 19:00:09 +02:00
boot.initrd = {
2024-10-16 22:19:53 +02:00
availableKernelModules = [ "r8169" ];
systemd.users.root.shell = "/bin/systemd-tty-ask-password-agent";
2024-10-16 19:00:09 +02:00
secrets = {"/root/initrd-ssh-key" = "/root/initrd-ssh-key";};
network = {
enable = true;
ssh = {
enable = true;
port = 2222;
2024-10-16 20:06:17 +02:00
hostKeys = [ /root/initrd-ssh-key ];
# this includes the ssh keys of all users in the wheel group, but you can just specify some keys manually
# authorizedKeys = [ "ssh-rsa ..." ];
authorizedKeys = with lib; concatLists (mapAttrsToList (name: user: if elem "wheel" user.extraGroups then user.openssh.authorizedKeys.keys else []) config.users.users);
};
2024-10-16 20:06:17 +02:00
};
2024-10-16 22:19:53 +02:00
};
2024-10-16 20:06:17 +02:00
}