-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nixos-minimal-installer.nix
50 lines (39 loc) · 1.62 KB
/
nixos-minimal-installer.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
42
43
44
45
46
47
48
49
50
{ lib, pkgs, config, nixpkgs-modules-path, ... }:
{
imports =
[
"${nixpkgs-modules-path}/nixos/modules/installer/cd-dvd/iso-image.nix"
# Profiles of this basic installation CD.
"${nixpkgs-modules-path}/nixos/modules/profiles/base.nix"
"${nixpkgs-modules-path}/nixos/modules/profiles/installation-device.nix"
];
# ISO naming.
isoImage.isoName = "${config.isoImage.isoBaseName}-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.iso";
# EFI booting
isoImage.makeEfiBootable = true;
# Add Memtest86+ to the CD.
boot.loader.grub.memtest86.enable = true;
# An installation media cannot tolerate a host config defined file
# system layout on a fresh machine, before it has been formatted.
swapDevices = lib.mkImageMediaOverride [ ];
fileSystems = lib.mkImageMediaOverride config.lib.isoFileSystems;
boot.postBootCommands = ''
for o in $(</proc/cmdline); do
case "$o" in
live.nixos.passwd=*)
set -- $(IFS==; echo $o)
echo "nixos:$2" | ${pkgs.shadow}/bin/chpasswd
;;
esac
done
'';
system.stateVersion = lib.mkDefault lib.trivial.release;
# Causes a lot of uncached builds for a negligible decrease in size.
environment.noXlibs = lib.mkOverride 500 false;
documentation.man.enable = lib.mkOverride 500 true;
# Although we don't really need HTML documentation in the minimal installer,
# not including it may cause annoying cache misses in the case of the NixOS manual.
documentation.doc.enable = lib.mkOverride 500 true;
fonts.fontconfig.enable = lib.mkForce false;
isoImage.edition = lib.mkForce "minimal";
}