Additionally, after talking with some other friends about making an automated deployment system to reduce the amount of manual maintenance I need (I need something I can just fire-and-forget) rather than using Docker to deploy my services, it was suggested that I should look into called NixOS.
Looking it over, I'm very interested: the description's of Hydra sound like they solve a lot of problems I've had with CI/Build environments - notably, that dependencies aren't tracked by the build system and there's no way to control changes to the build environment.
NixOS has a built in tool for building custom liveCDs, which should be perfect for the headless installer... Except for one problem... NixOS's documentation kinda sucks. Which is a shame.
Thanks to some help from the #nixos irc channel on freenode, and the manual, I've managed to build that image.
1. These steps can only be performed from an existing nixos environment.
2. Check-out the nixos-small repository, then cd into it.
git clone --branch nixos-16.09-small https://github.com/NixOS/nixpkgs-channels.git nixpkgs
cd nixpkgs/nixos3. Create a configuration file modules/installer/cd-dvd/installation-cd-ssh.nix
{ config, lib, pkgs, ... }:
{
imports =
[ ./installation-cd-base.nix
];
environment.systemPackages =
[
pkgs.vim
];
services.openssh.enable=true;
services.openssh.permitRootLogin="yes";
systemd.services.sshd.wantedBy = lib.mkForce [ "multi-user.target" ];
users.extraUsers.root = {
initialPassword = "PregeneratedPassword";
};
}
4. Build the iso
nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-ssh.nixDone.