helm/hosts/linode.nix

86 lines
2.1 KiB
Nix
Raw Normal View History

2020-01-13 14:57:52 -08:00
# 1. Create three (3) disk images:
# - Installer: 1024mb
# - Swap: 512mb
# - NixOS: rest
#
# 2. Boot in rescue mode with:
# - /dev/sda -> Installer
# - /dev/sdb -> Swap
# - /dev/sdc -> NixOS
#
# 3. Once booted into Finnix (step 2) pipe this script to sh:
2020-11-17 12:27:50 -08:00
# iso=https://channels.nixos.org/nixos-20.09/latest-nixos-minimal-x86_64-linux.iso
2020-01-13 14:57:52 -08:00
# update-ca-certificates
# curl $url | dd of=/dev/sda
#
2020-11-17 12:27:50 -08:00
# 4. Create two configuration profiles:
# - Installer
# - Kernel: Direct Disk
# - /dev/sda -> NixOS
# - /dev/sdb -> Swap
# - /dev/sdc -> Installer
# - Helpers: distro and auto network helpers = off
# - Boot
# - Kernel: GRUB 2
# - /dev/sda -> NixOS
# - /dev/sdb -> Swap
# - Helpers: distro and auto network helpers = off
2020-01-13 14:57:52 -08:00
#
2020-11-17 12:27:50 -08:00
# 5. Boot into installer profile.
#
# 6. Install dotfiles:
# mount /dev/sda /mnt
# swapon /dev/sdb
# nix-env -iA nixos.git
# nix-env -iA nixos.nixFlakes
# mkdir -p /mnt/home/hlissner
# git clone https://github.com/hlissner/dotfiles /mnt/home/hlissner/.config/dotfiles
# nixos-install --root "$(PREFIX)" --flake /mnt/home/hlissner/.config/dotfiles#linode
2020-01-13 14:57:52 -08:00
#
2020-11-17 12:27:50 -08:00
# 7. Reboot into "Boot" profile.
2020-01-13 14:57:52 -08:00
{ config, lib, pkgs, ... }:
2020-10-26 02:48:12 -07:00
with lib;
2020-01-13 14:57:52 -08:00
{
environment.systemPackages =
with pkgs; [ inetutils mtr sysstat git ];
modules = {
editors = {
default = "nvim";
vim.enable = true;
};
shell = {
git.enable = true;
zsh.enable = true;
};
services.ssh.enable = true;
};
2020-01-13 14:57:52 -08:00
# GRUB
boot = {
kernelParams = [ "console=ttyS0" ];
loader = {
timeout = 10;
grub = {
enable = true;
version = 2;
device = "nodev";
copyKernels = true;
fsIdentifier = "provided";
extraConfig = "serial; terminal_input serial; terminal_output serial";
};
# Disable globals
systemd-boot.enable = false;
efi.canTouchEfiVariables = false;
};
};
networking = {
useDHCP = false;
usePredictableInterfaceNames = false;
interfaces.eth0.useDHCP = true;
};
2020-01-13 14:57:52 -08:00
}