Add linode config
This commit is contained in:
parent
9ba14aa0a8
commit
81231f81ce
4
Makefile
4
Makefile
|
@ -12,6 +12,10 @@ install: result channels update config
|
|||
@nixos-generate-config --root "$(PREFIX)"
|
||||
@nixos-install --root "$(PREFIX)"
|
||||
|
||||
install-linode: result channels update
|
||||
@sudo mkdir -p "$(NIXOS_PREFIX)"
|
||||
@echo "(import $(PWD)/dotfiles \"linode\") \"$$(hostname)\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix"
|
||||
|
||||
upgrade: update switch
|
||||
|
||||
switch:
|
||||
|
|
69
machines/linode/default.nix
Normal file
69
machines/linode/default.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
# 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:
|
||||
# iso=<nixos-64bit-iso-url>
|
||||
# update-ca-certificates
|
||||
# curl $url | dd of=/dev/sda
|
||||
#
|
||||
# 4. Install these dotfiles with
|
||||
# git clone https://github.com/hlissner/dotfiles ~/.dotfiles
|
||||
# ln -s ~/.dotfiles /etc/dotfiles
|
||||
# cd ~/.dotfiles
|
||||
# mk install-linode
|
||||
#
|
||||
# 4. Create a configuration profile:
|
||||
# - Kernel: GRUB 2
|
||||
# - /dev/sda -> NixOS
|
||||
# - /dev/sdb -> Swap
|
||||
# - Helpers: distro and auto network helpers = off
|
||||
#
|
||||
# 5. Reboot into profile.
|
||||
|
||||
host:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages =
|
||||
with pkgs; [ inetutils mtr sysstat git ];
|
||||
|
||||
imports = [
|
||||
../.
|
||||
<my/modules/editors/vim.nix>
|
||||
<my/modules/shell/git.nix>
|
||||
<my/modules/shell/zsh.nix>
|
||||
<my/modules/services/ssh.nix>
|
||||
"./${host}.nix"
|
||||
];
|
||||
|
||||
# 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;
|
||||
networking.usePredictableInterfaceNames = false;
|
||||
networking.interfaces.eth0.useDHCP = true;
|
||||
|
||||
time.timeZone = "America/Toronto";
|
||||
}
|
Loading…
Reference in a new issue