depot/ops/nixos/netboot/default.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0
{ depot, lib, pkgs, config, ... }:
let
inherit (depot.ops) secrets;
in {
imports = [
../../../third_party/nixpkgs/nixos/modules/installer/netboot/netboot-minimal.nix
];
environment.noXlibs = false;
services.getty.autologinUser = lib.mkForce "root";
systemd.services.sshd.wantedBy = lib.mkOverride 0 [ "multi-user.target" ];
boot.kernelPackages = pkgs.linuxPackages_latest;
2021-01-30 18:47:01 +00:00
environment.systemPackages = with depot.pkgs; [
2021-01-30 17:56:46 +00:00
mprime
2021-01-30 18:47:01 +00:00
hp-rom
2021-01-30 17:56:46 +00:00
];
system.build.netbootWrap = pkgs.symlinkJoin {
name = "netboot";
paths = with config.system.build; [
netbootRamdisk
kernel
netbootIpxeScript
];
};
system.build.pixiecore = pkgs.writeScript "netboot-pixiecore.sh" ''
n="$(realpath ${config.system.build.netbootWrap})"
init="$(grep -ohP 'init=\S+' "$n/netboot.ipxe")"
pixiecore="${pkgs.pixiecore}"
exec "$pixiecore/bin/pixiecore" \
boot "$n/bzImage" "$n/initrd" \
--cmdline "$init loglevel=4" \
--debug --dhcp-no-bind --port 64172 --status-port 64172
'';
system.stateVersion = "21.05";
}