You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.6 KiB
Nix
88 lines
2.6 KiB
Nix
{ nixosSrc ? { outPath = ./.; revCount = 1234; shortRev = "abcdefg"; }
|
|
, nixpkgs ? { outPath = <nixpkgs>; revCount = 5678; shortRev = "gfedcba"; }
|
|
, officialRelease ? false
|
|
}:
|
|
|
|
let
|
|
|
|
version = builtins.readFile ./.version;
|
|
versionSuffix = "pre${toString nixosSrc.revCount}_${nixosSrc.shortRev}-${nixpkgs.shortRev}";
|
|
|
|
systems = [ "x86_64-linux" "i686-linux" ];
|
|
|
|
pkgs = import <nixpkgs> { system = "x86_64-linux"; };
|
|
|
|
|
|
versionModule =
|
|
{ system.nixosVersionSuffix = pkgs.lib.optionalString (!officialRelease) versionSuffix; };
|
|
|
|
|
|
makeIso =
|
|
{ module, type, description ? type, maintainers ? ["eelco"], system }:
|
|
|
|
with import <nixpkgs> { inherit system; };
|
|
|
|
let
|
|
|
|
config = (import lib/eval-config.nix {
|
|
inherit system;
|
|
modules = [ module versionModule { isoImage.isoBaseName = "nixos-${type}"; } ];
|
|
}).config;
|
|
|
|
iso = config.system.build.isoImage;
|
|
|
|
in
|
|
# Declare the ISO as a build product so that it shows up in Hydra.
|
|
runCommand "nixos-iso-${config.system.nixosVersion}"
|
|
{ meta = {
|
|
description = "NixOS installation CD (${description}) - ISO image for ${system}";
|
|
maintainers = map (x: lib.getAttr x lib.maintainers) maintainers;
|
|
};
|
|
inherit iso;
|
|
passthru = { inherit config; };
|
|
}
|
|
''
|
|
mkdir -p $out/nix-support
|
|
echo "file iso" $iso/iso/*.iso* >> $out/nix-support/hydra-build-products
|
|
'';
|
|
|
|
in {
|
|
iso_minimal = pkgs.lib.genAttrs systems (system: makeIso {
|
|
#module = ./modules/installer/cd-dvd/installation-cd-minimal.nix;
|
|
module = /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix;
|
|
type = "minimal";
|
|
inherit system;
|
|
});
|
|
|
|
# A bootable VirtualBox virtual appliance as an OVA file (i.e. packaged OVF).
|
|
ova = pkgs.lib.genAttrs systems (system:
|
|
|
|
with import <nixpkgs> { inherit system; };
|
|
|
|
let
|
|
|
|
config = (import lib/eval-config.nix {
|
|
inherit system;
|
|
modules =
|
|
[ versionModule
|
|
./modules/installer/virtualbox-demo.nix
|
|
];
|
|
}).config;
|
|
|
|
in
|
|
# Declare the OVA as a build product so that it shows up in Hydra.
|
|
runCommand "nixos-ova-${config.system.nixosVersion}-${system}"
|
|
{ meta = {
|
|
description = "NixOS VirtualBox appliance (${system})";
|
|
maintainers = lib.maintainers.eelco;
|
|
};
|
|
ova = config.system.build.virtualBoxOVA;
|
|
}
|
|
''
|
|
mkdir -p $out/nix-support
|
|
fn=$(echo $ova/*.ova)
|
|
echo "file ova $fn" >> $out/nix-support/hydra-build-products
|
|
'' # */
|
|
|
|
);
|
|
} |