# 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")
    ];


  fileSystems."/" =
    { device = "/dev/disk/by-uuid/c888d639-8af5-44c9-8692-24756792a960";
      fsType = "ext4";
    };

  boot.initrd.luks.devices."luks-dd4f8026-08be-4db0-abca-b92e71afd3f7".device = "/dev/disk/by-uuid/dd4f8026-08be-4db0-abca-b92e71afd3f7";

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/FF76-573E";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices = [
		{
			device = "/var/lib/swapfile";
			size = 16 * 1024; # 16 GiB
		}
	];

  # 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.enp57s0u1u2.useDHCP = lib.mkDefault true;
  # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
	# hardware.opengl.enable = true;
	# hardware.graphics.enable = true;
	hardware.graphics = {
		enable = true;
		enable32Bit = true;
		extraPackages = with pkgs; [
			# libva-intel-driver
			libva-utils
			intel-media-driver # Uncomment if you want to use the Intel Media Driver
			vaapiIntel
			vpl-gpu-rt
			libglvnd
			mesa
		];
		extraPackages32 = with pkgs.pkgsi686Linux; [
			# libva-intel-driver
			libglvnd
		];
	};
	systemd.services.wifi-powersave-off = {
		description = "Disable WiFi Power Save";
		wantedBy = [ "multi-user.target" ];
		requires = [ "network-online.target" ];
		after = [ "network-online.target" ];
		serviceConfig.Type = "oneshot";
		script = ''
			IF=$(${pkgs.iw}/bin/iw dev | ${pkgs.gawk}/bin/awk "/Interface/ {print \$2; exit}")
			if [ -n "$IF" ]; then
				${pkgs.iw}/bin/iw dev "$IF" set power_save off
			fi
		'';
	};
	networking.hostName = "xps13"; # Define your hostname.
	# networking.networkmanager.enable = true;
	networking.wireless = {
		enable = true;
		userControlled.enable = true;
		networks = {
			MyLocalTech = {
				pskRaw = "ac1030d721d26deb2c7db10073dfac73244e9621f4462e3e568017da03201e0e";
			};
		};
		extraConfig = ''
			country=US
			pmf=1
		'';
	};
	hardware.bluetooth = {
		enable = true;
		powerOnBoot = true;
		settings = {
			General = {
				Experimental = true;
				FastConnectable = true;
			};
			Policy = {
				AutoEnable = true;
			};
		};
	};
}
