about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-01-16 12:54:11 -0500
committerGitHub <noreply@github.com>2018-01-16 12:54:11 -0500
commit4dff3ee959035fadc77b0c2ac949a006b4249b20 (patch)
treeac6f9d73d12df35f1f78c7b6dd122c86e7cdb34c /nixos
parentb55d4c0564b0bde4cbc0c01b6ba7a1276382335a (diff)
parent4ccf308d665fd2cd60c57d2fe17d5c597570e978 (diff)
Merge pull request #33749 from dezgeg/release-refactor-1
nixos/release.nix: Refactoring for better multi-system support
Diffstat (limited to 'nixos')
-rw-r--r--nixos/release.nix32
1 files changed, 11 insertions, 21 deletions
diff --git a/nixos/release.nix b/nixos/release.nix
index 33916243e97bb..39c550b627746 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -3,6 +3,7 @@
 , supportedSystems ? [ "x86_64-linux" "aarch64-linux" ]
 }:
 
+with import ../pkgs/top-level/release-lib.nix { inherit supportedSystems; };
 with import ../lib;
 
 let
@@ -11,8 +12,6 @@ let
   versionSuffix =
     (if stableBranch then "." else "pre") + "${toString nixpkgs.revCount}.${nixpkgs.shortRev}";
 
-  forAllSystems = genAttrs supportedSystems;
-
   importTest = fn: args: system: import fn ({
     inherit system;
   } // args);
@@ -124,22 +123,13 @@ 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 = forTheseSystems [ "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;
@@ -147,7 +137,7 @@ in rec {
     inherit system;
   });
 
-  iso_graphical = genAttrs [ "x86_64-linux" ] (system: makeIso {
+  iso_graphical = forTheseSystems [ "x86_64-linux" ] (system: makeIso {
     module = ./modules/installer/cd-dvd/installation-cd-graphical-kde.nix;
     type = "graphical";
     inherit system;
@@ -155,7 +145,7 @@ in rec {
 
   # 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 = forTheseSystems [ "x86_64-linux" ] (system: makeIso {
     module = ./modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix;
     type = "minimal-new-kernel";
     inherit system;
@@ -163,7 +153,7 @@ in rec {
 
 
   # A bootable VirtualBox virtual appliance as an OVA file (i.e. packaged OVF).
-  ova = genAttrs [ "x86_64-linux" ] (system:
+  ova = forTheseSystems [ "x86_64-linux" ] (system:
 
     with import nixpkgs { inherit system; };