infrastructure/machines/core-services-01/netboot-server.nix
raito 2283ee602a Integrate core-services-01 in a nice workflow (#1)
This enables the tracking of core-services-01 over the infrastructure repository.

Co-authored-by: Gabriel DORIATH DOHLER <gabriel.doriath.dohler@ens.psl.eu>
Reviewed-on: https://git.rz.ens.wtf/Klub-RZ/infrastructure/pulls/1
Co-authored-by: raito <raito@noreply.git.rz.ens.wtf>
Co-committed-by: raito <raito@noreply.git.rz.ens.wtf>
2021-07-26 01:29:05 +02:00

45 lines
1.3 KiB
Nix

{ 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;
};
}