-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-big.nix
41 lines (41 loc) · 1.43 KB
/
release-big.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
with import <nixpkgs/lib>;
let
pkgs = import <nixpkgs> {};
configFor = modules: (import <nixpkgs/nixos/lib/eval-config.nix> {
system = "x86_64-linux";
modules = modules;
}).config.system.build;
configForMachine = machineName:
configFor [(./machines + "/${machineName}.nix")];
targetsForProfile = profileName: {
iso = (configFor [(./profiles + "/${profileName}-iso.nix")]).isoImage;
netboot = let
configEvaled = import <nixpkgs/nixos/lib/eval-config.nix> {
system = "x86_64-linux";
modules = [(./profiles + "/${profileName}-netboot.nix")];
};
build = configEvaled.config.system.build;
kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget;
in
pkgs.symlinkJoin {
name = "netboot";
paths = [
build.netbootRamdisk
build.kernel
build.netbootIpxeScript
];
postBuild = ''
mkdir -p $out/nix-support
echo "file ${kernelTarget} ${build.kernel}/${kernelTarget}" >> $out/nix-support/hydra-build-products
echo "file initrd ${build.netbootRamdisk}/initrd" >> $out/nix-support/hydra-build-products
echo "file ipxe ${build.netbootIpxeScript}/netboot.ipxe" >> $out/nix-support/hydra-build-products
'';
preferLocalBuild = true;
};
};
in rec
{
profiles = genAttrs [
"desktop"
] targetsForProfile;
}