mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Reinstall inspiron with luks encryption
This commit is contained in:
parent
741ae7ad3c
commit
4d97c46219
3 changed files with 74 additions and 14 deletions
66
hosts/inspiron/disko.nix
Normal file
66
hosts/inspiron/disko.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
type = "disk";
|
||||
device = "/dev/nvme0n1";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
type = "EF00";
|
||||
size = "512M";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "defaults" ];
|
||||
};
|
||||
};
|
||||
luks = {
|
||||
size = "100%";
|
||||
content = {
|
||||
name = "cryptroot";
|
||||
type = "luks";
|
||||
settings = {
|
||||
allowDiscards = true;
|
||||
keyFile = "/dev/disk/by-id/usb-SMI_USB_DISK-0:0";
|
||||
keyFileSize = 4096;
|
||||
keyFileTimeout = 5;
|
||||
};
|
||||
additionalKeyFiles = [ "/tmp/secret.key" ];
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "pool";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
lvm_vg = {
|
||||
pool = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
swap = {
|
||||
size = "20G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = [ "defaults" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,26 +1,20 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/92437114-de06-4a78-9ee3-c7d0ffcabf95";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D8B4-1218";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ { device = "/dev/disk/by-uuid/1eba93d1-4853-4534-8cfd-5c14e29c6ff6"; } ];
|
||||
imports = [
|
||||
inputs.disko.nixosModules.default
|
||||
./disko.nix
|
||||
];
|
||||
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.initrd.kernelModules = [ "usb_storage" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
zramSwap.enable = true;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
settings = {
|
||||
devices = {
|
||||
north.id = "ROS2S76-ULQWVFC-7KNQQ6Q-MNIWNKT-2QOPPHY-FFQZNVM-GUJRTHE-NZBM3QY";
|
||||
inspiron.id = "GUXHL6J-J2HWYNN-7JZJ5CN-6LPYGJD-H7GYRLQ-ORZ4PJJ-5K4WT7I-MELMIQO";
|
||||
inspiron.id = "K7V6PJV-3HLR6FI-VTFRJRN-ECG2ZYI-TNT4F5G-2WVQBDW-S77CHYL-VCAATAV";
|
||||
};
|
||||
|
||||
folders =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue