From a8c1bc8c7fb672e8c93e752ec1c9405aa5a4fc14 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Mon, 17 Apr 2023 00:03:57 +0300 Subject: [PATCH] add hardware conf for Dell-Laptop --- .../Dell-Laptop/hardware-configuration.nix | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 machines/Dell-Laptop/hardware-configuration.nix diff --git a/machines/Dell-Laptop/hardware-configuration.nix b/machines/Dell-Laptop/hardware-configuration.nix new file mode 100644 index 0000000..89ad1f3 --- /dev/null +++ b/machines/Dell-Laptop/hardware-configuration.nix @@ -0,0 +1,119 @@ +# 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" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "rpool/nixos/root"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/home" = + { device = "rpool/user/home"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/persist" = + { device = "rpool/persistent/impermanence"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/srv" = + { device = "rpool/persistent/servers"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/etc/secrets" = + { device = "rpool/persistent/secrets"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/nix" = + { device = "rpool/persistent/nix"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/var/log" = + { device = "rpool/persistent/log"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/var/lib/docker" = + { device = "rpool/persistent/docker"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/var/lib/containers" = + { device = "rpool/persistent/containers"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/var/lib/nixos-containers" = + { device = "rpool/persistent/nixos-containers"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/media/bittorrent" = + { device = "rpool/persistent/bittorrent"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/var/lib/libvirt" = + { device = "rpool/persistent/libvirt"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/media/libvirt" = + { device = "rpool/persistent/libvirt-user"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/media/libvirt/images" = + { device = "rpool/persistent/libvirt-user/images"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/boot" = + { device = "bpool/nixos/boot"; + fsType = "zfs"; options = [ "zfsutil" "X-mount.mkdir" ]; + }; + + fileSystems."/efi" = + { device = "/dev/disk/by-uuid/01F6-72E7"; + fsType = "vfat"; + }; + + swapDevices = [ + { + device = "/dev/disk/by-partuuid/e6605a31-26bb-437c-9de7-88fcfd4326b2"; + randomEncryption.enable = true; + randomEncryption.allowDiscards = true; + } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + networking.hostId = "08411033"; + boot.zfs.devNodes = "/dev/disk/by-id"; + boot.supportedFilesystems = [ "zfs" ]; + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-partuuid/c9110970-1e2d-47fd-828c-c5ecedf772c2"; +}