summary refs log tree commit diff
path: root/hosts/navi/hardware-configuration.nix
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-07-29 20:53:14 +0300
committertzlil <tzlils@protonmail.com>2023-07-29 20:53:14 +0300
commitfeefcfc89b00d4955dbb3314c20be035f3db206f (patch)
tree5099a13763dcfd274cae83af4dbac0bf4bef6cce /hosts/navi/hardware-configuration.nix
parent11526bdd2bb3b4b445665aa671e4bc72021b8183 (diff)
disko for laptop, wip rewrite
Diffstat (limited to 'hosts/navi/hardware-configuration.nix')
-rw-r--r--hosts/navi/hardware-configuration.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/hosts/navi/hardware-configuration.nix b/hosts/navi/hardware-configuration.nix
new file mode 100644
index 0000000..7b24c68
--- /dev/null
+++ b/hosts/navi/hardware-configuration.nix
@@ -0,0 +1,71 @@
+{
+  inputs,
+  pkgs,
+  lib,
+  config,
+  ...
+}: let
+  device = "/dev/nvme0n1";
+in {
+  imports = [
+    inputs.disko.nixosModules.disko
+    inputs.hardware.nixosModules.common-cpu-intel
+    inputs.hardware.nixosModules.common-gpu-intel
+  ];
+
+  hardware.firmware = [pkgs.rtw88-firmware];
+
+  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+
+  hardware.enableAllFirmware = true;
+
+  hardware.bluetooth.enable = true;
+
+  disko.devices = {
+    disk.${baseNameOf device} = {
+      inherit device;
+      type = "disk";
+      content = {
+        type = "gpt";
+        partitions = {
+          boot = {
+            type = "EF00";
+            size = "512M";
+            content = {
+              type = "filesystem";
+              format = "vfat";
+              mountpoint = "/boot";
+            };
+          };
+          root = {
+            size = "100%";
+            content = {
+              type = "luks";
+              name = "cryptroot";
+              content = {
+                type = "btrfs";
+                extraArgs = ["-f"];
+                subvolumes = {
+                  "/nix" = {
+                    mountOptions = ["compress=zstd" "noatime"];
+                    mountpoint = "/nix";
+                  };
+                };
+              };
+            };
+          };
+        };
+      };
+    };
+    nodev."/" = {
+      fsType = "tmpfs";
+      mountOptions = [
+        "size=8G"
+        "defaults"
+        "mode=755"
+      ];
+    };
+  };
+}