Skip to content

Instantly share code, notes, and snippets.

@pshirshov
Created January 26, 2022 13:18
Show Gist options
  • Save pshirshov/29493544f0a1b72e1684173674786bb0 to your computer and use it in GitHub Desktop.
Save pshirshov/29493544f0a1b72e1684173674786bb0 to your computer and use it in GitHub Desktop.
NixOS / flakes / pixiecore
services.pixiecore =
let
key = "...";
nixpkgs = lib.cleanSource pkgs.path;
nixos = (import "${lib.cleanSource pkgs.path}/nixos/lib/eval-config.nix" {
system = "x86_64-linux";
modules =
[
"${lib.cleanSource pkgs.path}/nixos/modules/installer/netboot/netboot.nix"
({ pkgs, ... }: {
services.getty.autologinUser = lib.mkForce "root";
users.users.root.openssh.authorizedKeys.keys = [ "${key}" ];
boot.supportedFilesystems = [ "zfs" ];
networking = {
hostName = "nixtmp";
hostId = "00000000";
};
services.openssh = {
enable = true;
permitRootLogin = "yes";
openFirewall = true;
};
environment.systemPackages = with pkgs; [
mc
nano
gptfdisk
parted
nvme-cli
efibootmgr
];
})
];
});
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;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment