nixos-config/configs/porani/hardware-configuration.nix

82 lines
1.8 KiB
Nix
Raw Normal View History

2019-12-20 05:54:26 +01:00
{ config, lib, pkgs, ... }: {
2019-12-24 00:44:59 +01:00
imports = [
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
{
2019-12-20 05:54:26 +01:00
boot.initrd.availableKernelModules =
[ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
2019-10-24 02:20:38 +02:00
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# grub configuration
# ------------------
boot.loader.grub = {
2019-12-20 05:54:26 +01:00
device = "/dev/sda";
enable = true;
2019-10-24 02:20:38 +02:00
version = 2;
};
# lvm volume group
# ----------------
2019-12-20 05:54:26 +01:00
boot.initrd.luks.devices = [{
name = "vg";
device = "/dev/sda2";
preLVM = true;
}];
2019-12-24 00:44:59 +01:00
}
# automount
# ---------
(let
mediaUUID = "3d106f56-89e5-400d-9d6b-1dd957919548";
in
{
fileSystems."/media" = {
#device = "/dev/disk/by-uuid/162c2f9e-8baa-4433-99fd-bb7e7b69472f";
device = "/dev/disk/by-uuid/${mediaUUID}";
fsType = "ext4";
options = [
"nofail"
"noauto"
#"x-systemd.device-timeout=1ms"
];
};
systemd.mounts = [{
enable = true;
options = "nofail,noauto";
type = "ext4";
wantedBy = [ "multi-user.target" ];
#what = "/dev/disk/by-uuid/162c2f9e-8baa-4433-99fd-bb7e7b69472f";
what = "/dev/disk/by-uuid/${mediaUUID}";
where = "/media";
}];
})
];
2019-10-24 02:20:38 +02:00
# NTFS support
# ------------
2019-12-20 05:54:26 +01:00
environment.systemPackages = [ pkgs.ntfs3g ];
2019-10-24 02:20:38 +02:00
# root
# ----
fileSystems."/" = {
options = [ "noatime" "nodiratime" "discard" ];
2019-12-20 05:54:26 +01:00
device = "/dev/vg/root";
fsType = "ext4";
2019-10-24 02:20:38 +02:00
};
# boot
# ----
fileSystems."/boot" = {
device = "/dev/sda1";
fsType = "ext4";
};
swapDevices = [ ];
nix.maxJobs = lib.mkDefault 4;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
}