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.
112 lines
3.1 KiB
Nix
112 lines
3.1 KiB
Nix
8 years ago
|
{ 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
|
||
|
''; # */
|
||
|
|
||
|
|
||
|
makeSystemTarball =
|
||
|
{ module, maintainers ? ["viric"], system }:
|
||
|
|
||
|
with import <nixpkgs> { inherit system; };
|
||
|
|
||
|
let
|
||
|
|
||
|
config = (import lib/eval-config.nix {
|
||
|
inherit system;
|
||
|
modules = [ module versionModule ];
|
||
|
}).config;
|
||
|
|
||
|
tarball = config.system.build.tarball;
|
||
|
|
||
|
in
|
||
|
tarball //
|
||
|
{ meta = {
|
||
|
description = "NixOS system tarball for ${system} - ${stdenv.platform.name}";
|
||
|
maintainers = map (x: lib.getAttr x lib.maintainers) maintainers;
|
||
|
};
|
||
|
inherit config;
|
||
|
};
|
||
|
|
||
|
|
||
|
in {
|
||
|
iso_minimal = pkgs.lib.genAttrs systems (system: makeIso {
|
||
|
module = ./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
|
||
|
'' # */
|
||
|
|
||
|
);
|
||
|
}
|