summaryrefslogtreecommitdiff
path: root/nixos/boot.nix
blob: 8cd3afa50e13ab6873c897c44bdb7223362625b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ config, ... }:

{
  imports = [ # Include the results of the hardware scan.
    ./hardware-configuration.nix
  ];

  boot.loader = {
    efi = { canTouchEfiVariables = true; };
    grub = {
      enable = true;
      version = 2;
      efiSupport = true;
      enableCryptodisk = true;
      device = "nodev";
      # extraEntries =
      #   # Recovery mode
      #   # Generate the image with generate-recovery.sh
      #   ''
      #   menuentry "NixOS - Recovery" {
      #   search --set=drive1 -fs-uuid 330B-45DE
      #          linux ($drive1)//kernels/recovery-linux-bzImage loglevel=4
      #          initrd ($drive1)//kernels/recovery-initrd
      #   }
      #   '';
    };
  };

  # Decrypt disk
  boot.initrd.luks.devices = {
    sda3_crypt = {
      name = "sda3_crypt";
      device = "/dev/disk/by-uuid/ba5dc9cd-3a73-4a01-880b-8720844307ae";
      preLVM = true;
    };
  };
}