Skip to content

Commit

Permalink
nixos/release.nix: Refactoring for better multi-system support
Browse files Browse the repository at this point in the history
Currently, even if you pass `supportedSystems = [ "aarch64-linux" ]` you
end up with e.g. `nixos.iso_graphical.x86_64-linux` job. Using the new
forSubsetOfSystems avoids that.

This shouldn't affect the usual x86 trunk-combined jobset.
  • Loading branch information
dezgeg committed Jan 11, 2018
1 parent 8d12c26 commit cdf3d7b
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions nixos/release.nix
Expand Up @@ -13,6 +13,8 @@ let

forAllSystems = genAttrs supportedSystems;

forSubsetOfSystems = systems: genAttrs (intersectLists supportedSystems systems);

importTest = fn: args: system: import fn ({
inherit system;
} // args);
Expand Down Expand Up @@ -124,46 +126,37 @@ in rec {
# Build the initial ramdisk so Hydra can keep track of its size over time.
initialRamdisk = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.initialRamdisk);

netboot = {
x86_64-linux = makeNetboot {
system = "x86_64-linux";
modules = [
./modules/installer/netboot/netboot-minimal.nix
versionModule
];
};
} // (optionalAttrs (elem "aarch64-linux" supportedSystems) {
aarch64-linux = makeNetboot {
system = "aarch64-linux";
modules = [
./modules/installer/netboot/netboot-minimal.nix
versionModule
];
};});
netboot = forSubsetOfSystems [ "x86_64-linux" "aarch64-linux" ] (system: makeNetboot {
inherit system;
modules = [
./modules/installer/netboot/netboot-minimal.nix
versionModule
];
});

iso_minimal = forAllSystems (system: makeIso {
module = ./modules/installer/cd-dvd/installation-cd-minimal.nix;
type = "minimal";
inherit system;
});

iso_graphical = genAttrs [ "x86_64-linux" ] (system: makeIso {
iso_graphical = forSubsetOfSystems [ "x86_64-linux" ] (system: makeIso {
module = ./modules/installer/cd-dvd/installation-cd-graphical-kde.nix;
type = "graphical";
inherit system;
});

# A variant with a more recent (but possibly less stable) kernel
# that might support more hardware.
iso_minimal_new_kernel = genAttrs [ "x86_64-linux" ] (system: makeIso {
iso_minimal_new_kernel = forSubsetOfSystems [ "x86_64-linux" ] (system: makeIso {
module = ./modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix;
type = "minimal-new-kernel";
inherit system;
});


# A bootable VirtualBox virtual appliance as an OVA file (i.e. packaged OVF).
ova = genAttrs [ "x86_64-linux" ] (system:
ova = forSubsetOfSystems [ "x86_64-linux" ] (system:

with import nixpkgs { inherit system; };

Expand Down

0 comments on commit cdf3d7b

Please sign in to comment.