Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c56b00247
|
||
|
|
ff2e4d2f69 | ||
|
|
318e17ac27
|
||
|
|
c66549f3bf | ||
|
|
620c415be9
|
||
|
|
472f359f80
|
||
|
|
ad494d1209 | ||
|
|
d26bd424cc
|
||
|
|
a7bba82b5b |
@@ -158,6 +158,25 @@ $ sudo sbctl status # Secure Boot: ✓ Enabled
|
|||||||
- If it doesn't boot anymore, disabling Secure Boot in the firmware boots as before
|
- If it doesn't boot anymore, disabling Secure Boot in the firmware boots as before
|
||||||
- Losing the keys isn't fatal: erase the keys in the firmware and start over at step 1
|
- Losing the keys isn't fatal: erase the keys in the firmware and start over at step 1
|
||||||
|
|
||||||
|
## how to unlock the disk with the tpm (laptops)
|
||||||
|
Needs Secure Boot first. The TPM releases the key only with the PIN and while
|
||||||
|
the Secure Boot state (PCR 7) is unchanged. The passphrase stays as fallback.
|
||||||
|
|
||||||
|
1. enroll the TPM with a PIN as an additional key slot
|
||||||
|
```bash
|
||||||
|
# asks for the current passphrase, then the new PIN
|
||||||
|
$ sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=7 --tpm2-with-pin=yes /dev/disk/by-label/nixcrypt
|
||||||
|
```
|
||||||
|
|
||||||
|
2. import `modules/nixos/tpm-unlock.nix` in the host's `configuration.nix`, rebuild and reboot
|
||||||
|
|
||||||
|
- If the passphrase is suddenly asked for instead of the PIN, the Secure Boot
|
||||||
|
state changed. After a firmware update that's expected, otherwise investigate
|
||||||
|
before typing the passphrase. To re-enroll:
|
||||||
|
```bash
|
||||||
|
$ sudo systemd-cryptenroll --wipe-slot=tpm2 --tpm2-device=auto --tpm2-pcrs=7 --tpm2-with-pin=yes /dev/disk/by-label/nixcrypt
|
||||||
|
```
|
||||||
|
|
||||||
## how to upgrade the system
|
## how to upgrade the system
|
||||||
```bash
|
```bash
|
||||||
$ cd /path/to/repo
|
$ cd /path/to/repo
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
../../modules/nixos/data-drives.nix
|
../../modules/nixos/data-drives.nix
|
||||||
../../modules/nixos/gnupg.nix
|
../../modules/nixos/gnupg.nix
|
||||||
../../modules/nixos/greetd.nix
|
../../modules/nixos/greetd.nix
|
||||||
|
../../modules/nixos/lanzaboote.nix
|
||||||
../../modules/nixos/locales.nix
|
../../modules/nixos/locales.nix
|
||||||
../../modules/nixos/networking.nix
|
../../modules/nixos/networking.nix
|
||||||
../../modules/nixos/niri.nix
|
../../modules/nixos/niri.nix
|
||||||
@@ -23,6 +24,7 @@
|
|||||||
../../modules/nixos/settings.nix
|
../../modules/nixos/settings.nix
|
||||||
../../modules/nixos/steam.nix
|
../../modules/nixos/steam.nix
|
||||||
../../modules/nixos/thunar.nix
|
../../modules/nixos/thunar.nix
|
||||||
|
../../modules/nixos/tpm-unlock.nix
|
||||||
../../modules/nixos/users.nix
|
../../modules/nixos/users.nix
|
||||||
../../modules/nixos/vial.nix
|
../../modules/nixos/vial.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
../../modules/nixos/services.nix
|
../../modules/nixos/services.nix
|
||||||
../../modules/nixos/settings.nix
|
../../modules/nixos/settings.nix
|
||||||
../../modules/nixos/steam.nix
|
../../modules/nixos/steam.nix
|
||||||
|
../../modules/nixos/tpm-unlock.nix
|
||||||
../../modules/nixos/users.nix
|
../../modules/nixos/users.nix
|
||||||
../../modules/nixos/vial.nix
|
../../modules/nixos/vial.nix
|
||||||
];
|
];
|
||||||
@@ -31,6 +32,13 @@
|
|||||||
# host-specific niri config (input devices, laptop binds)
|
# host-specific niri config (input devices, laptop binds)
|
||||||
home-manager.users.aaron.imports = [ ./niri.nix ];
|
home-manager.users.aaron.imports = [ ./niri.nix ];
|
||||||
|
|
||||||
|
# hidpi panel (2880x1920): the sddm greeter runs in weston, which doesn't scale
|
||||||
|
services.displayManager.sddm.settings.General.GreeterEnvironment = "QT_SCALE_FACTOR=2";
|
||||||
|
|
||||||
|
# bigger boot menu font, mode found with "r" in the menu; mode 6 is beyond
|
||||||
|
# what boot.loader.systemd-boot.consoleMode accepts, so set via lanzaboote
|
||||||
|
boot.lanzaboote.settings.console-mode = "6";
|
||||||
|
|
||||||
networking.hostName = "krypton";
|
networking.hostName = "krypton";
|
||||||
system.stateVersion = "26.05"; # don't change
|
system.stateVersion = "26.05"; # don't change
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
# set bootloader to systemd
|
# set bootloader to systemd
|
||||||
boot.loader = {
|
boot.loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
|
# no kernel command line editing at the boot menu (e.g. init=/bin/sh)
|
||||||
|
systemd-boot.editor = false;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# Unlock cryptroot with the TPM and a PIN, the passphrase stays as fallback.
|
||||||
|
# The TPM only releases the key while PCR 7 (the Secure Boot state) matches,
|
||||||
|
# so this needs lanzaboote.nix. Enrolled once per host with
|
||||||
|
# `systemd-cryptenroll`, see INSTALLATION.md.
|
||||||
|
|
||||||
|
{
|
||||||
|
boot.initrd.luks.devices."cryptroot".crypttabExtraOpts = [ "tpm2-device=auto" ];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user