56 lines
1.3 KiB
Nix
56 lines
1.3 KiB
Nix
{
|
|
outputs,
|
|
lib,
|
|
pkgs,
|
|
modulesPath,
|
|
...
|
|
}:
|
|
{
|
|
imports = [
|
|
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
|
|
];
|
|
|
|
nixpkgs.hostPlatform = "x86_64-linux";
|
|
|
|
image.baseName = lib.mkForce "nixos-zfs-installer";
|
|
|
|
# Keep the live kernel and ZFS in sync with the deployed systems so pools
|
|
# created by the installer import cleanly on first boot.
|
|
boot = {
|
|
kernelPackages = pkgs.linuxPackages_6_18;
|
|
zfs.package = pkgs.zfs_2_4;
|
|
supportedFilesystems.zfs = true;
|
|
};
|
|
|
|
networking.hostName = "installer";
|
|
|
|
# On flake-built systems <nixpkgs> resolves through the flake registry,
|
|
# so nixos-install fails without these features enabled.
|
|
nix.settings.experimental-features = [
|
|
"flakes"
|
|
"nix-command"
|
|
];
|
|
|
|
environment.systemPackages = [
|
|
outputs.packages.${pkgs.stdenv.hostPlatform.system}.installer-nixos
|
|
];
|
|
|
|
# Live-media only: sshd is already enabled by the installation profile,
|
|
# but ssh logins need a non-empty password.
|
|
users.users = {
|
|
nixos = {
|
|
password = "nixos";
|
|
initialHashedPassword = lib.mkForce null;
|
|
};
|
|
root = {
|
|
password = "nixos";
|
|
initialHashedPassword = lib.mkForce null;
|
|
};
|
|
};
|
|
|
|
services.getty.helpLine = ''
|
|
Run "sudo nixos-installer" to install NixOS onto a ZFS root pool.
|
|
SSH is enabled; the "nixos" and "root" passwords are "nixos".
|
|
'';
|
|
}
|