2024-10-16 16:57:55 +02:00
|
|
|
{ config, pkgs, lib, inputs, ... }: with config.lyn.lib; {
|
|
|
|
imports =
|
|
|
|
[
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
lyn.kernel.latest.enable = true;
|
|
|
|
lyn.profiles.base.enable = true;
|
2024-10-18 23:01:33 +02:00
|
|
|
lyn.users.lyn.enable = true;
|
|
|
|
networking.hostName = "supernova";
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
2024-10-16 22:50:37 +02:00
|
|
|
|
2024-10-18 23:01:33 +02:00
|
|
|
# this is overridden by the secureboot profile, still here so the system retains a bootloader in case secure boot profile is disabled:
|
2024-10-16 16:57:55 +02:00
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
2024-10-17 00:19:04 +02:00
|
|
|
# Firmware updates:
|
|
|
|
services.fwupd.enable = true;
|
2024-10-16 22:50:37 +02:00
|
|
|
|
2024-10-18 23:01:33 +02:00
|
|
|
##1##3##3##7##
|
2024-10-16 22:50:37 +02:00
|
|
|
## Security ##
|
2024-10-18 23:01:33 +02:00
|
|
|
##1##3##3##7##
|
|
|
|
|
2024-10-16 22:50:37 +02:00
|
|
|
# Kernel hardening
|
|
|
|
lyn.kernel.hardened.enable = true;
|
|
|
|
|
|
|
|
# Secure boot
|
|
|
|
lyn.profiles.secureboot.enable = true;
|
|
|
|
|
2024-10-18 23:01:33 +02:00
|
|
|
# FDE + initrd stuff
|
|
|
|
boot.kernelParams = [ "ip=dhcp" ];
|
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 = {
|
2024-10-16 16:57:55 +02:00
|
|
|
enable = true;
|
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
port = 2222;
|
2024-10-18 23:01:33 +02:00
|
|
|
# WARNING: this key will be globally accessible through Nix store. Don't use the booted/decrypted systems host key here.
|
2024-10-16 20:06:17 +02:00
|
|
|
hostKeys = [ /root/initrd-ssh-key ];
|
2024-10-16 16:57:55 +02:00
|
|
|
# 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-18 23:01:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
system.stateVersion = "24.05";
|
2024-10-16 20:06:17 +02:00
|
|
|
}
|