Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

host: add netboot default build target #105

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ in
let
modpath = "nixos/modules";
cd = "installer/cd-dvd/installation-cd-minimal-new-kernel.nix";
netboot = "installer/netboot/netboot.nix";
isoConfig = (nixosSystem
(args // {
modules = modules ++ [
Expand All @@ -75,10 +76,18 @@ in
})
];
})).config;
netbootConfig = (nixosSystem
(args // {
modules = modules ++ [
"${nixos}/${modpath}/${netboot}"
];
})).config;
in
modules ++ [{
system.build = {
iso = isoConfig.system.build.isoImage;
netbootRamdisk = netbootConfig.system.build.netbootRamdisk;
netbootIpxeScript = netbootConfig.system.build.netbootIpxeScript;
};
}];
});
Expand Down
6 changes: 5 additions & 1 deletion shell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let
system="${"\${system//\\\"/"}}"

if [[ -z "$1" ]]; then
echo "Usage: $(basename $0) [ up | iso {host} | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]"
echo "Usage: $(basename $0) [ up | (iso|netboot-ramdisk|netboot-ipxe) {host} | install {host} | {host} [switch|boot|test] | home {host} {user} [switch] ]"
elif [[ "$1" == "up" ]]; then
mkdir -p "$DEVSHELL_ROOT/up"
hostname="$(hostname)"
Expand All @@ -28,6 +28,10 @@ let
git add -f "$DEVSHELL_ROOT/hosts/up-$hostname.nix"
elif [[ "$1" == "iso" ]]; then
nix build "$DEVSHELL_ROOT#nixosConfigurations.$2.${build}.iso" "${"\${@:3}"}"
elif [[ "$1" == "netboot-ramdisk" ]]; then
nix build "$DEVSHELL_ROOT#nixosConfigurations.$2.${build}.netbootRamdisk" "${"\${@:3}"}"
elif [[ "$1" == "netboot-ipxe" ]]; then
nix build "$DEVSHELL_ROOT#nixosConfigurations.$2.${build}.netbootIpxeScript" "${"\${@:3}"}"
elif [[ "$1" == "install" ]]; then
sudo nixos-install --flake "$DEVSHELL_ROOT#$2" "${"\${@:3}"}"
elif [[ "$1" == "home" ]]; then
Expand Down