{ pkgs, lib, config, inputs, modulesPath, ... }: let hostConfig = config; pixiecore = config.services.pixiecore; pxeHostName = "nixos-pxe"; nixos = import (modulesPath + "/../lib/eval-config.nix") { system = null; specialArgs = { # Required to avoid infinite recursion # when `inputs` is used in `imports`. inherit inputs; }; modules = [ ({ config, pkgs, lib, ... }: { imports = [ (modulesPath + "/installer/netboot/netboot-minimal.nix") ../../nixos/default.nix ]; config = { nixpkgs.hostPlatform = { system = "x86_64-linux"; config = "x86_64-unknown-linux-gnu"; }; ## Some useful options for setting up a new system services.getty.autologinUser = lib.mkForce "root"; users.users.root.openssh.authorizedKeys.keys = hostConfig.users.users.julm.openssh.authorizedKeys.keys; console.keyMap = "de"; # hardware.video.hidpi.enable = true; system.stateVersion = config.system.nixos.release; _module.args = { hostName = pxeHostName; #hosts = nixosConfigurations; #host = nixosConfigurations.${hostName}._module.args; }; nixpkgs.overlays = import ../../nixpkgs/overlays.nix; documentation = { enable = false; doc.enable = false; }; }; }) inputs.home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.verbose = true; #home-manager.force = true; home-manager.backupFileExtension = "old"; home-manager.extraSpecialArgs = { hostName = pxeHostName; inherit inputs; }; } ]; }; build = nixos.config.system.build; in { services.pixiecore = { enable = true; mode = "boot"; debug = true; dhcpNoBind = false; port = 64172; statusPort = 64172; kernel = "${build.kernel}/bzImage"; initrd = "${build.netbootRamdisk}/initrd"; cmdLine = "init=${build.toplevel}/init loglevel=4"; extraArguments = []; }; networking.nftables.ruleset = '' table inet filter { chain input-lan { udp dport 67 counter accept comment "Pixiecore/DHCP" udp dport 69 counter accept comment "Pixiecore/TFTP" udp dport 4011 counter accept comment "Pixiecore/ProxyDHCP" tcp dport ${toString pixiecore.port} counter accept comment "Pixiecore" tcp dport ${toString pixiecore.statusPort} counter accept comment "Pixiecore/status" } chain output-lan { } } ''; }