summaryrefslogtreecommitdiff
path: root/machines/radon/pxeboot.nix
blob: 465599017e49a9fe34e71371fb5cf55f61008807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ pkgs, lib, ... }:
let
  installer = lib.nixosSystem {
    system = "x86_64-linux";
    modules = [
      ({ config, pkgs, lib, modulesPath, ... }: {
        imports = [
          (modulesPath + "/installer/netboot/netboot-minimal.nix")
          (modulesPath + "/installer/cd-dvd/channel.nix")
        ];

        services.openssh = {
          enable = true;
          openFirewall = true;
          settings = {
            PasswordAuthentication = false;
            KbdInteractiveAuthentication = false;
          };
        };

        nix.settings = {
          experimental-features = [ "nix-command" "flakes" ];
        };

        users.users.root.openssh.authorizedKeys.keys = [
          "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP7T2uWJFUu8aFZZgQusGKyEMocb2pKbHLDad2eIJus9"
          "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEOw8YEbHsKy38JHp9W1wcxxZgWCDgnabOXccZUN5ddd"
        ];
      })
    ];
  };

  inherit (installer.config.system) build;
in
{
  services.pixiecore = {
    enable = true;
    openFirewall = true;
    kernel = "${build.kernel}/bzImage";
    initrd = "${build.netbootRamdisk}/initrd";
    cmdLine = "init=${build.toplevel}/init loglevel=4";
    mode = "boot";
    port = 8001;
    statusPort = 8001;

    # Piggyback on existing network DHCP
    dhcpNoBind = true;
  };
}