flake/hosts/supernova/default.nix

72 lines
1.9 KiB
Nix
Raw Normal View History

2024-10-29 08:55:56 +01:00
{
config,
pkgs,
lib,
inputs,
...
}:
with config.lyn.lib; {
imports = [
./hardware-configuration.nix
./virtualization.nix
];
lyn.kernel.latest.enable = true;
lyn.profiles.base.enable = true;
lyn.profiles.headless.enable = true;
2024-10-18 23:01:33 +02:00
lyn.users.lyn.enable = true;
2024-11-09 21:16:53 +01:00
lyn.users.ellie.enable = true;
2024-10-18 23:01:33 +02:00
networking.hostName = "supernova";
boot.loader.efi.canTouchEfiVariables = true;
2024-10-29 08:55:56 +01: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:
boot.loader.systemd-boot.enable = true;
# Firmware updates:
services.fwupd.enable = true;
2024-11-14 01:36:01 +01:00
lyn.services.wgautomesh = {
enable = true;
2025-01-14 18:56:49 +01:00
enable_upnp = true;
2024-11-14 01:36:01 +01:00
};
2024-10-18 23:01:33 +02:00
##1##3##3##7##
## Security ##
2024-10-18 23:01:33 +02:00
##1##3##3##7##
# Kernel hardening
lyn.kernel.hardened.enable = true;
2024-10-29 08:55:56 +01:00
## Don't print any errors/logs to the console
boot.consoleLogLevel = 0;
2024-10-29 08:55:56 +01:00
# Secure boot
lyn.profiles.secureboot.enable = true;
2024-10-18 23:01:33 +02:00
# FDE + initrd stuff
2024-10-29 08:55:56 +01:00
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-29 08:55:56 +01:00
availableKernelModules = ["r8169"];
2024-10-16 22:19:53 +02:00
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;
2024-10-29 08:55:56 +01:00
ssh = {
enable = true;
port = 2222;
# WARNING: this key will be globally accessible through Nix store. Don't use the booted/decrypted systems host key here.
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-18 23:01:33 +02:00
2024-10-29 08:55:56 +01:00
system.stateVersion = "24.05";
2024-10-16 20:06:17 +02:00
}