2015-08-22 23:28:41 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2015-08-23 00:48:35 +00:00
|
|
|
# ssd #
|
2015-08-22 23:28:41 +00:00
|
|
|
# sda: bootloader grub2
|
|
|
|
# sda1: boot ext4 (label nixboot)
|
2015-10-17 09:17:11 +00:00
|
|
|
# sda2: cryptoluks ->
|
|
|
|
# lvm:
|
|
|
|
# / (main-root)
|
|
|
|
# /home (main-home)
|
2015-08-23 00:48:35 +00:00
|
|
|
|
2019-05-08 11:58:51 +00:00
|
|
|
# clean the boot sector:
|
|
|
|
# dd if=/dev/zero of=/dev/sda count=2048
|
|
|
|
# Installation Instruction on ISO:
|
|
|
|
# fdisk /dev/sda
|
|
|
|
# boot 500M
|
|
|
|
# rest rest
|
|
|
|
# cryptsetup luksFormat /dev/sda2
|
|
|
|
# mkfs.ext4 -L nixboot /dev/sda1
|
|
|
|
# cryptsetup luksOpen /dev/sda2 cryptoluks
|
|
|
|
# pvcreate /dev/mapper/cryptoluks
|
|
|
|
# vgcreate main /dev/mapper/cryptoluks
|
|
|
|
# lvcreate -L 200Gib main -n root
|
|
|
|
# lvcreate -L 800Gib main -n home
|
|
|
|
# mkfs.ext4 /dev/main/root
|
|
|
|
# mkfs.ext4 /dev/main/home
|
|
|
|
# mount /dev/mapper/main-root /mnt
|
|
|
|
# mkdir -p /mnt/{boot,home,var/src} /var/src
|
|
|
|
# mount /dev/sda1 /mnt/boot
|
|
|
|
# mount /dev/mapper/main-home /mnt/home
|
|
|
|
# touch /mnt/var/src/.populate
|
|
|
|
# mount -o bind /mnt/var/src /var/src
|
|
|
|
# nix-channel --add https://nixos.org/channels/nixos-19.03 nixpkgs && # nix-channel --update
|
|
|
|
# nix-env -iA nixpkgs.gitMinimal
|
|
|
|
# (on deploy-host) $(nix-build ~/stockholm/makefu/krops.nix --no-out-link --argstr name x --argstr target 10.42.22.91 -A deploy --show-trace)
|
|
|
|
# NIXOS_CONFIG=/var/src/nixos-config nixos-install -I /var/src --no-root-passwd --no-channel-copy
|
2015-08-22 23:28:41 +00:00
|
|
|
{
|
|
|
|
|
2015-10-16 20:58:54 +00:00
|
|
|
imports = [
|
2015-10-17 09:17:11 +00:00
|
|
|
./sda-crypto-root.nix # configures crypto + boot
|
2015-10-16 20:58:54 +00:00
|
|
|
];
|
2015-08-22 23:28:41 +00:00
|
|
|
fileSystems = {
|
2015-10-17 09:17:11 +00:00
|
|
|
"/".device = lib.mkForce "/dev/mapper/main-root";
|
2015-08-22 23:28:41 +00:00
|
|
|
"/home" = {
|
|
|
|
device = "/dev/mapper/main-home";
|
|
|
|
fsType = "ext4";
|
2016-04-01 12:28:16 +00:00
|
|
|
options = [ "defaults" "discard" ];
|
2015-08-22 23:28:41 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|