Skip to content

Instantly share code, notes, and snippets.

@pshirshov
Created October 30, 2022 11:35
Show Gist options
  • Save pshirshov/40e0a9548c2baf031b3bef6ef341fa1e to your computer and use it in GitHub Desktop.
Save pshirshov/40e0a9548c2baf031b3bef6ef341fa1e to your computer and use it in GitHub Desktop.
pxe/nixos
{ config, pkgs, lib, ... }:
{
#...
services.pixiecore = let
nixos = (import "${lib.cleanSource pkgs.path}/nixos/lib/eval-config.nix" {
system = "x86_64-linux";
modules = [ ./pxe.nix ];
});
build = nixos.config.system.build;
in {
enable = true;
openFirewall = true;
kernel = "${build.kernel}/bzImage";
initrd = "${toString build.netbootRamdisk}/initrd";
cmdLine = "init=.${build.toplevel}/init ${
lib.concatStringsSep " " nixos.config.boot.kernelParams
} boot.shell_on_fail";
dhcpNoBind = true;
};
#...
}
{ lib, pkgs, config, modulesPath, ... }:
{
services.getty.autologinUser = lib.mkForce "root";
users.users.root.openssh.authorizedKeys.keys = [ config.sshkeys.pavel ];
users.users.root.password = "nixos";
boot.supportedFilesystems = [ "zfs" ];
boot.kernelPackages = config.currentKernel;
imports = [
(modulesPath + "/installer/netboot/netboot.nix")
(modulesPath + "/installer/cd-dvd/channel.nix")
../../shared-configs/consts.nix
../../shared-configs/generic/any.nix
];
networking = {
hostName = "nixtmp";
hostId = "00000000";
};
nixpkgs = {
overlays = [
(self: super: {
nix-quick-install = pkgs.callPackage
"${config.localPkgs}/nix-quick-install/nix-quick-install.nix" { };
})
];
};
hardware = {
cpu.intel.updateMicrocode = true;
cpu.amd.updateMicrocode = true;
video.hidpi.enable = true;
};
environment.systemPackages = with pkgs; [ nix-quick-install ];
system.stateVersion = config.systemStateVersion;
}
@pshirshov
Copy link
Author

Seems like just

    nixos = inputs.nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./pxe.nix ];
    };

fixes the issue

@pshirshov
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment