3 { nixpkgs ? { outPath = cleanSource ./..; revCount = 708350; shortRev = "1d95cb5"; }
5 , supportedSystems ? [ "x86_64-linux" "aarch64-linux" ]
9 with import ../pkgs/top-level/release-lib.nix { inherit supportedSystems; };
13 version = fileContents ../.version;
15 (if stableBranch then "." else "beta") + "${toString nixpkgs.revCount}.${nixpkgs.shortRev}";
17 # Run the tests for each platform. You can run a test by doing
18 # e.g. ‘nix-build release.nix -A tests.login.x86_64-linux’,
19 # or equivalently, ‘nix-build tests/login.nix’.
20 # See also nixosTests in pkgs/top-level/all-packages.nix
21 allTestsForSystem = system:
22 import ./tests/all-tests.nix {
24 pkgs = import ./.. { inherit system; };
26 ${system} = hydraJob config.test;
29 # for typechecking of the scripts and evaluation of
30 # the nodes, without running VMs.
32 import ./tests/all-tests.nix {
34 pkgs = import ./.. { inherit system; };
36 ${system} = hydraJob config.driver;
42 foldAttrs recursiveUpdate {} (map allTestsForSystem supportedSystems);
44 pkgs = import ./.. { system = "x86_64-linux"; };
47 versionModule = { config, ... }: {
48 system.nixos.versionSuffix = versionSuffix;
49 system.nixos.revision = nixpkgs.rev or nixpkgs.shortRev;
51 # At creation time we do not have state yet, so just default to latest.
52 system.stateVersion = config.system.nixos.release;
55 makeModules = module: rest: [ configuration versionModule module rest ];
58 { module, type, system, ... }:
60 with import ./.. { inherit system; };
62 hydraJob ((import lib/eval-config.nix {
64 modules = makeModules module {
65 isoImage.isoBaseName = "nixos-${type}";
67 }).config.system.build.isoImage);
71 { module, system, ... }:
73 with import ./.. { inherit system; };
75 hydraJob ((import lib/eval-config.nix {
77 modules = makeModules module {};
78 }).config.system.build.sdImage);
82 { module, maintainers ? ["viric"], system }:
84 with import ./.. { inherit system; };
88 config = (import lib/eval-config.nix {
90 modules = makeModules module {};
93 tarball = config.system.build.tarball;
98 description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.linux-kernel.name}";
99 maintainers = map (x: lib.maintainers.${x}) maintainers;
105 makeClosure = module: buildFromConfig module (config: config.system.build.toplevel);
108 buildFromConfig = module: sel: forAllSystems (system: hydraJob (sel (import ./lib/eval-config.nix {
110 modules = makeModules module
112 { fileSystems."/".device = mkDefault "/dev/sda1";
113 boot.loader.grub.device = mkDefault "/dev/sda";
117 makeNetboot = { module, system, ... }:
119 configEvaled = import lib/eval-config.nix {
121 modules = makeModules module {};
123 build = configEvaled.config.system.build;
124 kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.linux-kernel.target;
126 configEvaled.pkgs.symlinkJoin {
131 build.netbootIpxeScript
134 mkdir -p $out/nix-support
135 echo "file ${kernelTarget} ${build.kernel}/${kernelTarget}" >> $out/nix-support/hydra-build-products
136 echo "file initrd ${build.netbootRamdisk}/initrd" >> $out/nix-support/hydra-build-products
137 echo "file ipxe ${build.netbootIpxeScript}/netboot.ipxe" >> $out/nix-support/hydra-build-products
139 preferLocalBuild = true;
144 channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; };
146 manualHTML = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualHTML);
147 manual = manualHTML; # TODO(@oxij): remove eventually
148 manualEpub = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.manualEpub));
149 nixos-configuration-reference-manpage = buildFromConfig ({ ... }: { }) (config: config.system.build.manual.nixos-configuration-reference-manpage);
150 options = (buildFromConfig ({ ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;
153 # Build the initial ramdisk so Hydra can keep track of its size over time.
154 initialRamdisk = buildFromConfig ({ ... }: { }) (config: config.system.build.initialRamdisk);
156 kexec = forMatchingSystems supportedSystems (system: (import lib/eval-config.nix {
159 ./modules/installer/netboot/netboot-minimal.nix
161 }).config.system.build.kexecTree);
163 netboot = forMatchingSystems supportedSystems (system: makeNetboot {
164 module = ./modules/installer/netboot/netboot-minimal.nix;
168 iso_minimal = forAllSystems (system: makeIso {
169 module = ./modules/installer/cd-dvd/installation-cd-minimal.nix;
174 iso_plasma5 = forMatchingSystems supportedSystems (system: makeIso {
175 module = ./modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma5.nix;
180 iso_plasma6 = forMatchingSystems supportedSystems (system: makeIso {
181 module = ./modules/installer/cd-dvd/installation-cd-graphical-calamares-plasma6.nix;
186 iso_gnome = forMatchingSystems supportedSystems (system: makeIso {
187 module = ./modules/installer/cd-dvd/installation-cd-graphical-calamares-gnome.nix;
192 # A variant with a more recent (but possibly less stable) kernel that might support more hardware.
193 # This variant keeps zfs support enabled, hoping it will build and work.
194 iso_minimal_new_kernel = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system: makeIso {
195 module = ./modules/installer/cd-dvd/installation-cd-minimal-new-kernel.nix;
196 type = "minimal-new-kernel";
200 # A variant with a more recent (but possibly less stable) kernel that might support more hardware.
201 # ZFS support disabled since it is unlikely to support the latest kernel.
202 iso_minimal_new_kernel_no_zfs = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system: makeIso {
203 module = ./modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix;
204 type = "minimal-new-kernel-no-zfs";
208 sd_image = forMatchingSystems [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ] (system: makeSdImage {
210 armv6l-linux = ./modules/installer/sd-card/sd-image-raspberrypi-installer.nix;
211 armv7l-linux = ./modules/installer/sd-card/sd-image-armv7l-multiplatform-installer.nix;
212 aarch64-linux = ./modules/installer/sd-card/sd-image-aarch64-installer.nix;
217 sd_image_new_kernel = forMatchingSystems [ "aarch64-linux" ] (system: makeSdImage {
219 aarch64-linux = ./modules/installer/sd-card/sd-image-aarch64-new-kernel-installer.nix;
221 type = "minimal-new-kernel";
225 sd_image_new_kernel_no_zfs = forMatchingSystems [ "aarch64-linux" ] (system: makeSdImage {
227 aarch64-linux = ./modules/installer/sd-card/sd-image-aarch64-new-kernel-no-zfs-installer.nix;
229 type = "minimal-new-kernel-no-zfs";
233 # KVM image for proxmox in VMA format
234 proxmoxImage = forMatchingSystems [ "x86_64-linux" ] (system:
235 with import ./.. { inherit system; };
237 hydraJob ((import lib/eval-config.nix {
240 ./modules/virtualisation/proxmox-image.nix
242 }).config.system.build.VMA)
245 # LXC tarball for proxmox
246 proxmoxLXC = forMatchingSystems [ "x86_64-linux" ] (system:
247 with import ./.. { inherit system; };
249 hydraJob ((import lib/eval-config.nix {
252 ./modules/virtualisation/proxmox-lxc.nix
254 }).config.system.build.tarball)
257 # A disk image that can be imported to Amazon EC2 and registered as an AMI
258 amazonImage = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
260 with import ./.. { inherit system; };
262 hydraJob ((import lib/eval-config.nix {
267 ./maintainers/scripts/ec2/amazon-image.nix
269 }).config.system.build.amazonImage)
272 amazonImageZfs = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
274 with import ./.. { inherit system; };
276 hydraJob ((import lib/eval-config.nix {
281 ./maintainers/scripts/ec2/amazon-image-zfs.nix
283 }).config.system.build.amazonImage)
288 # Test job for https://github.com/NixOS/nixpkgs/issues/121354 to test
289 # automatic sizing without blocking the channel.
290 amazonImageAutomaticSize = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
292 with import ./.. { inherit system; };
294 hydraJob ((import lib/eval-config.nix {
299 ./maintainers/scripts/ec2/amazon-image.nix
300 ({ ... }: { virtualisation.diskSize = "auto"; })
302 }).config.system.build.amazonImage)
306 # An image that can be imported into incus and used for container creation
307 incusContainerImage =
315 with import ./.. { inherit system; };
318 (import lib/eval-config.nix {
323 ./maintainers/scripts/incus/incus-container-image.nix
325 }).config.system.build.squashfs
329 # Metadata for the incus image
339 with import ./.. { inherit system; };
342 (import lib/eval-config.nix {
347 ./maintainers/scripts/incus/incus-container-image.nix
349 }).config.system.build.metadata
353 # An image that can be imported into incus and used for container creation
354 incusVirtualMachineImage =
363 with import ./.. { inherit system; };
366 (import lib/eval-config.nix {
371 ./maintainers/scripts/incus/incus-virtual-machine-image.nix
373 }).config.system.build.qemuImage
377 # Metadata for the incus image
378 incusVirtualMachineImageMeta =
387 with import ./.. { inherit system; };
390 (import lib/eval-config.nix {
395 ./maintainers/scripts/incus/incus-virtual-machine-image.nix
397 }).config.system.build.metadata
401 # An image that can be imported into lxd and used for container creation
402 lxdContainerImage = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
404 with import ./.. { inherit system; };
406 hydraJob ((import lib/eval-config.nix {
411 ./maintainers/scripts/lxd/lxd-container-image.nix
413 }).config.system.build.tarball)
417 lxdContainerImageSquashfs = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
419 with import ./.. { inherit system; };
421 hydraJob ((import lib/eval-config.nix {
426 ./maintainers/scripts/lxd/lxd-container-image.nix
428 }).config.system.build.squashfs)
432 # Metadata for the lxd image
433 lxdContainerMeta = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
435 with import ./.. { inherit system; };
437 hydraJob ((import lib/eval-config.nix {
442 ./maintainers/scripts/lxd/lxd-container-image.nix
444 }).config.system.build.metadata)
448 # An image that can be imported into lxd and used for container creation
449 lxdVirtualMachineImage = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
451 with import ./.. { inherit system; };
453 hydraJob ((import lib/eval-config.nix {
458 ./maintainers/scripts/lxd/lxd-virtual-machine-image.nix
460 }).config.system.build.qemuImage)
464 # Metadata for the lxd image
465 lxdVirtualMachineImageMeta = forMatchingSystems [ "x86_64-linux" "aarch64-linux" ] (system:
467 with import ./.. { inherit system; };
469 hydraJob ((import lib/eval-config.nix {
474 ./maintainers/scripts/lxd/lxd-virtual-machine-image.nix
476 }).config.system.build.metadata)
480 # Ensure that all packages used by the minimal NixOS config end up in the channel.
481 dummy = forAllSystems (system: pkgs.runCommand "dummy"
482 { toplevel = (import lib/eval-config.nix {
484 modules = singleton ({ ... }:
485 { fileSystems."/".device = mkDefault "/dev/sda1";
486 boot.loader.grub.device = mkDefault "/dev/sda";
487 system.stateVersion = mkDefault lib.trivial.release;
489 }).config.system.build.toplevel;
490 preferLocalBuild = true;
492 "mkdir $out; ln -s $toplevel $out/dummy");
495 # Provide container tarball for lxc, libvirt-lxc, docker-lxc, ...
496 containerTarball = forAllSystems (system: makeSystemTarball {
497 module = ./modules/virtualisation/lxc-container.nix;
503 /* Build a bunch of typical closures so that Hydra can keep track of
504 the evolution of closure sizes. */
508 smallContainer = makeClosure ({ ... }:
509 { boot.isContainer = true;
510 services.openssh.enable = true;
513 tinyContainer = makeClosure ({ ... }:
514 { boot.isContainer = true;
515 imports = [ modules/profiles/minimal.nix ];
518 ec2 = makeClosure ({ ... }:
519 { imports = [ modules/virtualisation/amazon-image.nix ];
522 kde = makeClosure ({ ... }:
523 { services.xserver.enable = true;
524 services.displayManager.sddm.enable = true;
525 services.xserver.desktopManager.plasma5.enable = true;
528 xfce = makeClosure ({ ... }:
529 { services.xserver.enable = true;
530 services.xserver.desktopManager.xfce.enable = true;
533 gnome = makeClosure ({ ... }:
534 { services.xserver.enable = true;
535 services.xserver.displayManager.gdm.enable = true;
536 services.xserver.desktopManager.gnome.enable = true;
539 pantheon = makeClosure ({ ... }:
540 { services.xserver.enable = true;
541 services.xserver.desktopManager.pantheon.enable = true;
544 deepin = makeClosure ({ ... }:
545 { services.xserver.enable = true;
546 services.xserver.displayManager.lightdm.enable = true;
547 services.xserver.desktopManager.deepin.enable = true;
550 # Linux/Apache/PostgreSQL/PHP stack.
551 lapp = makeClosure ({ pkgs, ... }:
552 { services.httpd.enable = true;
553 services.httpd.adminAddr = "foo@example.org";
554 services.httpd.enablePHP = true;
555 services.postgresql.enable = true;
556 services.postgresql.package = pkgs.postgresql;