86 lines
2.9 KiB
Nix
86 lines
2.9 KiB
Nix
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||
# and may be overwritten by future invocations. Please make changes
|
||
# to /etc/nixos/configuration.nix instead.
|
||
{ config, lib, pkgs, modulesPath, ... }:
|
||
|
||
{
|
||
imports =
|
||
[
|
||
(modulesPath + "/installer/scan/not-detected.nix")
|
||
];
|
||
|
||
boot = {
|
||
initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||
initrd.kernelModules = [ ];
|
||
kernelModules = [ "kvm-intel" ];
|
||
extraModulePackages = [ ];
|
||
};
|
||
|
||
fileSystems = {
|
||
"/" = {
|
||
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@" "compress=zstd" "noatime" ];
|
||
};
|
||
"/home" = {
|
||
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@home" "compress=zstd" "noatime" ];
|
||
};
|
||
"/swap" = {
|
||
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@swap" "compress=zstd" "noatime" ];
|
||
};
|
||
"/nix" = {
|
||
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
|
||
};
|
||
"/var/log" = {
|
||
device = "/dev/disk/by-uuid/23782fe8-86f7-4aa1-afc1-6586443d0d3e";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@log" "compress=zstd" "noatime" ];
|
||
};
|
||
"/boot" = {
|
||
device = "/dev/disk/by-uuid/8EFC-70D8";
|
||
fsType = "vfat";
|
||
};
|
||
};
|
||
|
||
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/1958da8c-d506-49a6-b983-dc8477d25b7c";
|
||
|
||
swapDevices = [{
|
||
device = "/swap/swapfile";
|
||
size = (1024 * 16) + (1024 * 2); # RAM size + 2GB
|
||
}];
|
||
|
||
systemd.services = {
|
||
create-swapfile = {
|
||
serviceConfig.Type = "oneshot";
|
||
wantedBy = [ "swap-swapfile.swap" ];
|
||
script = ''
|
||
swapfile="/swap/swapfile"
|
||
if [[ -f "$swapfile" ]]; then
|
||
echo "Swap file $swapfile already exists, taking no action."
|
||
else
|
||
echo "Setting up swap file $swapfile..."
|
||
${pkgs.coreutils}/bin/truncate -s 0 /swap/swapfile
|
||
${pkgs.e2fsprogs}/bin/chattr +C /swap/swapfile
|
||
echo "Done."
|
||
fi
|
||
'';
|
||
};
|
||
};
|
||
|
||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||
# still possible to use this option, but it's recommended to use it in conjunction
|
||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||
networking.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.enp0s13f0u2u4.useDHCP = lib.mkDefault true;
|
||
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
|
||
|
||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||
}
|