Hello
I am building a NixOSConfiguration
and a package
with initrd and the kernel for future use.
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
deploy-rs.url = "github:serokell/deploy-rs";
};
outputs = { self, nixpkgs, deploy-rs }: {
nixosConfigurations = {
blackhole = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ config, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/netboot/netboot-base.nix")
];
})
];
};
};
packages.x86_64-linux.blackhole = nixpkgs.legacyPackages.x86_64-linux.symlinkJoin {
name = "blackhole";
paths = with self.nixosConfigurations.blackhole.config.system.build; [
netbootRamdisk
kernel
];
};
};
}
I build it with:
$ nix build .#blackhole
The netboot module can generate a file called netbooting.pxe
nixpkgs/netboot.nix at 9bc01704b4c2ac26d90ebe83accd5c0833afbbd3 · NixOS/nixpkgs · GitHub
I would like to add to my package a similar file containing only the path of the init script: init=${config.system.build.toplevel}/init
because I would like to read that file later when I use this package.
Any feedback about how I can do it?
Thanks a lot