infrastructure/machines/core-services-01/netboot-server.nix

46 lines
1.3 KiB
Nix
Raw Normal View History

{ pkgs, config, ... }:
let
bootSystem = import <nixpkgs/nixos> {
configuration = { config, pkgs, lib, ... }: with lib; {
imports = [
<nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix>
];
# Early init the serial console
boot.kernelParams = [ "console=tty1" "console=ttyS0,115200" ];
## Some useful options for setting up a new system
services.getty.autologinUser = mkForce "root";
# Enable sshd wich gets disabled by netboot-minimal.nix
systemd.services.sshd.wantedBy = mkOverride 0 [ "multi-user.target" ];
users.users.root.openssh.authorizedKeys.keyFiles = [
./pubkeys/gdd.keys
./pubkeys/raito.keys
./pubkeys/hackens-milieu.keys
];
programs.mosh.enable = true;
console.keyMap = "us";
};
};
netboot = pkgs.symlinkJoin {
name = "netboot";
paths = with bootSystem.config.system.build; [
netbootRamdisk
kernel
netbootIpxeScript
];
preferLocalBuild = true;
};
in {
services.pixiecore = {
enable = true;
kernel = "${netboot}/bzImage";
initrd = "${netboot}/initrd";
cmdLine = "init=${bootSystem.config.system.build.toplevel}/init loglevel=4";
debug = true;
dhcpNoBind = true;
port = 64172;
statusPort = 64172;
};
}