Skip to content

Instantly share code, notes, and snippets.

@dhl
dhl / nixos-install-encrypted-root.sh
Created October 31, 2018 02:41 — forked from sveitser/nixos-install-encrypted-root.sh
Installs nixos on encrypted root from live CD.
#!usr/bin/env bash
#
# Installs nixos with full disk encrypted root partition.
#
# - Prompts for password initially, after that no interaction should
# be required.
# - At the end it will prompt for a root password, could not make
# echo-ing it into nixos-install work.
# - Reserves 550MB for boot partition, rest for the root volume.
# - After booting, log in as root user and set password for normal user.
#!/usr/bin/perl
$f = $ARGV[0];
$pagestart = 0;
$charstart = 0;
$kernstart = 0;
$s = "<?xml version=\"1.0\"?>\n<font>\n";
open(F, $f);