76 lines
1.7 KiB
Nix
76 lines
1.7 KiB
Nix
{ config, lib, pkgs, ... }: {
|
|
imports = [
|
|
<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
|
|
{
|
|
|
|
boot.initrd.availableKernelModules =
|
|
[ "ehci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
|
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
|
boot.kernelModules = [ "kvm-intel" ];
|
|
boot.extraModulePackages = [ ];
|
|
|
|
# grub configuration
|
|
# ------------------
|
|
boot.loader.grub = {
|
|
device = "/dev/sda";
|
|
enable = true;
|
|
version = 2;
|
|
};
|
|
|
|
# lvm volume group
|
|
# ----------------
|
|
boot.initrd.luks.devices = [{
|
|
name = "vg";
|
|
device = "/dev/sda2";
|
|
preLVM = true;
|
|
}];
|
|
}
|
|
|
|
# automount
|
|
# ---------
|
|
(let mediaUUID = "3d106f56-89e5-400d-9d6b-1dd957919548";
|
|
in {
|
|
fileSystems."/media" = {
|
|
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/${mediaUUID}";
|
|
where = "/media";
|
|
}];
|
|
})
|
|
];
|
|
|
|
# NTFS support
|
|
# ------------
|
|
environment.systemPackages = [ pkgs.ntfs3g ];
|
|
|
|
# root
|
|
# ----
|
|
fileSystems."/" = {
|
|
options = [ "noatime" "nodiratime" "discard" ];
|
|
device = "/dev/vg/root";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
# boot
|
|
# ----
|
|
fileSystems."/boot" = {
|
|
device = "/dev/sda1";
|
|
fsType = "ext4";
|
|
};
|
|
|
|
swapDevices = [ ];
|
|
|
|
nix.maxJobs = lib.mkDefault 4;
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
}
|