aboutsummaryrefslogtreecommitdiff
path: root/nixos/configurations/hardware
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2021-12-28 01:11:25 +0900
committersefidel <contact@sefidel.net>2021-12-28 01:12:48 +0900
commit56992b8c945d497a623fe693847c91235be1ae02 (patch)
tree102ff8c8872d7e14ce3e3dba69bf16685374504e /nixos/configurations/hardware
downloadnixrc-56992b8c945d497a623fe693847c91235be1ae02.zip
initial commit
Diffstat (limited to 'nixos/configurations/hardware')
-rw-r--r--nixos/configurations/hardware/alpha.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixos/configurations/hardware/alpha.nix b/nixos/configurations/hardware/alpha.nix
new file mode 100644
index 0000000..e8d3e17
--- /dev/null
+++ b/nixos/configurations/hardware/alpha.nix
@@ -0,0 +1,55 @@
+{ config, lib, pkgs, ... }:
+
+let
+ espDev = "/dev/disk/by-uuid/7905-2E41";
+ btrfsDev = "/dev/disk/by-uuid/dc47a0a6-3c73-45c1-951c-40032e762180";
+ swapDev = "/dev/disk/by-uuid/4a74b247-99e9-42c7-9a86-75aea964bb85";
+ dataDev = "/dev/disk/by-uuid/fe7a00a8-0a3c-48de-9d7a-ed7cf172f501";
+
+ subvolume = name: {
+ device = btrfsDev;
+ fsType = "btrfs";
+ options = [ "subvol=${name}" "compress=zstd" "noatime" ];
+ };
+in
+{
+ boot.initrd.availableKernelModules = [ "xhci-pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-amd" ];
+ boot.extraModulePackages = [ ];
+
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+ hardware.enableRedistributableFirmware = true;
+
+ fileSystems."/" = subvolume "root";
+ fileSystems."/home" = subvolume "home";
+ fileSystems."/nix" = subvolume "nix";
+ fileSystems."/persist" = subvolume "persist";
+ fileSystems."/var/log" = {
+ device = btrfsDev;
+ fsType = "btrfs";
+ options = [ "subvol=log" "compress=zstd" "noatime" ];
+ neededForBoot = true;
+ };
+
+ fileSystems."/boot" = {
+ device = espDev;
+ fsType = "vfat";
+ };
+
+ fileSystems."/data" = {
+ device = dataDev;
+ fsType = "ext4";
+ };
+
+ fileSystems."/tmp" = {
+ fsType = "tmpfs";
+ device = "tmpfs";
+ options = [ "nosuid" "nodev" "relatime" "size=14G" ];
+ };
+
+ swapDevices = [{ device = swapDev; }];
+
+ nix.maxJobs = lib.mkDefault 4;
+ powerManagement.cpuFreqGovernor = lib.mkDefault "schedutil";
+}