Add netboot archive (including to installer workflow)
This commit is contained in:
parent
22bf75d0a0
commit
f7410f134e
@ -1,4 +1,4 @@
|
||||
name: Installer ISO
|
||||
name: Installer
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -6,7 +6,7 @@ on:
|
||||
|
||||
jobs:
|
||||
installer:
|
||||
name: Build installer ISO
|
||||
name: Build installer
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@ -24,20 +24,27 @@ jobs:
|
||||
extra-substituters = https://nix-cache.nul.ie/main
|
||||
extra-trusted-public-keys = main:mMChkG8LwXrFirVfudqjSHasK1jV31OVElYD3eImYl8=
|
||||
- name: Set up attic
|
||||
id: setup
|
||||
run: |
|
||||
nix run .#nixpkgs.mine.x86_64-linux.attic-client -- \
|
||||
login --set-default colony https://nix-cache.nul.ie "${{ secrets.NIX_CACHE_TOKEN }}"
|
||||
echo "short_rev=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Build installer ISO
|
||||
id: build
|
||||
run: |
|
||||
nix build .#nixosConfigurations.installer.config.my.buildAs.iso
|
||||
short_rev="$(git rev-parse --short HEAD)"
|
||||
ln -s result/iso/nixos-installer-devplayer0.iso nixos-installer-devplayer0-$short_rev.iso
|
||||
echo "short_rev=$short_rev" >> "$GITHUB_OUTPUT"
|
||||
- name: Create release for ISO
|
||||
ln -s "$(readlink result)"/iso/nixos-installer-devplayer0.iso \
|
||||
nixos-installer-devplayer0-${{ steps.setup.outputs.short_rev }}.iso
|
||||
- name: Build installer netboot archive
|
||||
run: |
|
||||
nix build .#nixosConfigurations.installer.config.my.buildAs.netbootArchive
|
||||
ln -s "$(readlink result)" \
|
||||
nixos-installer-devplayer0-netboot-${{ steps.setup.outputs.short_rev }}.tar
|
||||
|
||||
- name: Create release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
title: Latest installer
|
||||
files: |
|
||||
nixos-installer-devplayer0-${{ steps.build.outputs.short_rev }}.iso
|
||||
nixos-installer-devplayer0-${{ steps.setup.outputs.short_rev }}.iso
|
||||
nixos-installer-devplayer0-netboot-${{ steps.setup.outputs.short_rev }}.tar
|
||||
|
@ -97,6 +97,18 @@ in
|
||||
help = "Build NixOS configuration into an ISO";
|
||||
command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.iso"'';
|
||||
}
|
||||
{
|
||||
name = "build-kexec";
|
||||
category = "tasks";
|
||||
help = "Build NixOS configuration as kexec tree";
|
||||
command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.kexecTree"'';
|
||||
}
|
||||
{
|
||||
name = "build-netboot";
|
||||
category = "tasks";
|
||||
help = "Build NixOS configuration as netboot archive";
|
||||
command = ''nix build "''${@:2}" ".#nixfiles.config.nixos.systems.\"$1\".configuration.config.my.buildAs.netbootArchive"'';
|
||||
}
|
||||
{
|
||||
name = "build-home";
|
||||
category = "tasks";
|
||||
|
@ -43,6 +43,16 @@ let
|
||||
modules = flatten [
|
||||
"${modulesPath}/installer/netboot/netboot.nix"
|
||||
allHardware
|
||||
({ pkgs, config, ... }: {
|
||||
system.build.netbootArchive = pkgs.runCommand "netboot-${config.system.name}-archive.tar" { } ''
|
||||
${pkgs.gnutar}/bin/tar -rvC "${config.system.build.kernel}" \
|
||||
-f "$out" "${config.system.boot.loader.kernelFile}"
|
||||
${pkgs.gnutar}/bin/tar -rvC "${config.system.build.netbootRamdisk}" \
|
||||
-f "$out" initrd
|
||||
${pkgs.gnutar}/bin/tar -rvC "${config.system.build.netbootIpxeScript}" \
|
||||
-f "$out" netboot.ipxe
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
@ -99,6 +109,7 @@ in
|
||||
iso = config.my.asISO.config.system.build.isoImage;
|
||||
container = config.my.asContainer.config.system.build.toplevel;
|
||||
kexecTree = config.my.asKexecTree.config.system.build.kexecTree;
|
||||
netbootArchive = config.my.asKexecTree.config.system.build.netbootArchive;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user