restructured directories + modularized btrfs mount
This commit is contained in:
99
hosts/workstation/hardware-configuration.nix
Normal file
99
hosts/workstation/hardware-configuration.nix
Normal file
@@ -0,0 +1,99 @@
|
||||
{ config, pkgs, modulesPath, lib, ... }: {
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
hardware = {
|
||||
cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
settings.General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
Experimental = true;
|
||||
};
|
||||
};
|
||||
opentabletdriver = {
|
||||
enable = true;
|
||||
daemon.enable = false;
|
||||
};
|
||||
};
|
||||
boot = {
|
||||
kernel.sysctl = {
|
||||
"vm.swappiness" = 80;
|
||||
"net.ipv6.conf.all.disable_ipv6" = 1;
|
||||
"net.ipv6.conf.lo.disable_ipv6" = 1;
|
||||
"net.ipv6.conf.default.disable_ipv6" = 1;
|
||||
"net.ipv4.tcp_mtu_probing" = 1;
|
||||
};
|
||||
loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
efiSysMountPoint = "/boot/efi";
|
||||
};
|
||||
grub = {
|
||||
enable = true;
|
||||
device = "nodev";
|
||||
efiSupport = true;
|
||||
useOSProber = true;
|
||||
enableCryptodisk = true;
|
||||
extraEntries = ''
|
||||
menuentry "Fedora" {
|
||||
set root=(hd1,1)
|
||||
chainloader /EFI/fedora/grubx64.efi
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
initrd.luks.devices.nvme = {
|
||||
device = "/dev/disk/by-uuid/e9618e85-a631-4374-b2a4-22c376d6e41b";
|
||||
preLVM = true;
|
||||
};
|
||||
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
|
||||
extraModprobeConfig = ''
|
||||
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
|
||||
'';
|
||||
initrd = {
|
||||
availableKernelModules =
|
||||
[ "xhci_pci" "ahci" "usbhid" "nvme" "usb_storage" "sd_mod" ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = let
|
||||
btrfsMount = subvol: {
|
||||
device = "/dev/mapper/nvme";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=${subvol}"
|
||||
"ssd"
|
||||
"compress=lzo"
|
||||
"x-systemd.device-timeout=0"
|
||||
"space_cache=v2"
|
||||
"commit=120"
|
||||
"datacow"
|
||||
] ++ (if subvol == "nixos" then [ "noatime" ] else [ ]);
|
||||
};
|
||||
in {
|
||||
"/" = btrfsMount "nixos" // { };
|
||||
"/home" = btrfsMount "home" // { };
|
||||
"/mnt/games" = btrfsMount "games" // { };
|
||||
# "/mnt/pool" = nfsMount "pool" // { };
|
||||
# "/mnt/jawz" = nfsMount "jawz" // { };
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/ac6d349a-96b9-499e-9009-229efd7743a5";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot/efi" = {
|
||||
device = "/dev/disk/by-uuid/B05D-B5FB";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
};
|
||||
swapDevices = [{
|
||||
device = "/dev/disk/by-partuuid/c1bd22d7-e62c-440a-88d1-6464be1aa1b0";
|
||||
randomEncryption = {
|
||||
enable = true;
|
||||
cipher = "aes-xts-plain64";
|
||||
keySize = 512;
|
||||
sectorSize = 4096;
|
||||
};
|
||||
}];
|
||||
}
|
||||
Reference in New Issue
Block a user