summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2025-03-22 21:47:10 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2025-03-22 21:47:10 +0100
commit4a5a9700dd5f60ce95fd53a24e99362ce5be6049 (patch)
treee6bf9ce1212a63e312cd8866c8333417d18cf081
parente7c2472f62a1b395301c03c83cf93b436fb3a76d (diff)
hardware: use generic config for crypted disk
-rw-r--r--config/hardware/default.nix11
-rw-r--r--config/hardware/hardware-configuration.nix49
2 files changed, 32 insertions, 28 deletions
diff --git a/config/hardware/default.nix b/config/hardware/default.nix
index 5b4f50f..3abd1bf 100644
--- a/config/hardware/default.nix
+++ b/config/hardware/default.nix
@@ -1,6 +1,8 @@
-{ nixos-hardware, modulesPath, ... }:
-
{
+ nixos-hardware,
+ modulesPath,
+ ...
+}: {
imports = [
(modulesPath + "/profiles/headless.nix")
./hardware-configuration.nix
@@ -12,9 +14,10 @@
personal.hardware = {
usb.enable = true;
firmwareNonFree.enable = true;
+ disks.crypted = "/dev/disk/by-uuid/47e77d74-1aad-4d99-9aa7-568d8524b305";
};
- swapDevices = [{ device = "/swap"; }];
+ swapDevices = [{device = "/swap";}];
# The CPU frequency should stay at the minimum until the router has
# some load to compute.
@@ -24,7 +27,7 @@
# The service irqbalance is useful as it assigns certain IRQ calls
# to specific CPUs instead of letting the first CPU core to handle
# everything. This is supposed to increase performance by hitting
- # CPU cache more often.
+ # CPU cache more often.
services.irqbalance.enable = true;
# Re-enable the serial console, disabled by the headless profile
diff --git a/config/hardware/hardware-configuration.nix b/config/hardware/hardware-configuration.nix
index 68cf8c9..ac28757 100644
--- a/config/hardware/hardware-configuration.nix
+++ b/config/hardware/hardware-configuration.nix
@@ -1,31 +1,32 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
-
{
- imports =
- [ (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ "kvm-amd" ];
- boot.extraModulePackages = [ ];
-
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/9e447187-fae1-466a-b37d-4de1fe240c6f";
- fsType = "ext4";
- };
-
- boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/47e77d74-1aad-4d99-9aa7-568d8524b305";
-
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/b99733fc-3734-41d3-8fe5-2682714f319e";
- fsType = "ext4";
- };
-
- swapDevices = [ ];
+ config,
+ lib,
+ modulesPath,
+ ...
+}: {
+ imports = [
+ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "ehci_pci" "usb_storage" "sd_mod" "sdhci_pci"];
+ boot.initrd.kernelModules = [];
+ boot.kernelModules = ["kvm-amd"];
+ boot.extraModulePackages = [];
+
+ fileSystems."/" = {
+ device = "/dev/disk/by-uuid/9e447187-fae1-466a-b37d-4de1fe240c6f";
+ fsType = "ext4";
+ };
+
+ fileSystems."/boot" = {
+ device = "/dev/disk/by-uuid/b99733fc-3734-41d3-8fe5-2682714f319e";
+ fsType = "ext4";
+ };
+
+ swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's