nix-config/modules/baremetal.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
925 B
Nix
Raw Normal View History

2023-05-19 21:38:16 +02:00
{ config, lib, pkgs, ... }:
{
options.c3d2.baremetal = lib.mkEnableOption "baremetal";
config = lib.mkIf config.c3d2.baremetal {
boot.initrd.network = {
enable = true;
ssh = {
enable = true;
authorizedKeys = config.users.users.root.openssh.authorizedKeys.keys;
hostKeys = [
"/etc/ssh/initrd/ssh_host_ed25519_key"
"/etc/ssh/initrd/ssh_host_rsa_key"
];
port = 4748;
};
postCommands = ''
cat <<EOF > /root/.profile
cryptsetup-askpass
EOF
'';
};
2023-05-19 21:38:16 +02:00
environment.systemPackages = with pkgs; [
lshw
pciutils # lscpi
smartmontools # for smartctl
];
2023-05-19 23:05:28 +02:00
nix.settings.system-features = [
"kvm" "big-parallel" "nixos-test" "benchmark"
];
2023-05-20 02:46:07 +02:00
services = {
# just assume there are ssd's everywhere
fstrim.enable = true;
smartd.enable = true;
};
2023-05-19 21:38:16 +02:00
};
}