summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/ahmed/configuration.nix16
-rw-r--r--hosts/ahmed/hardware-configuration.nix40
-rw-r--r--modules/nixos/disable-screen/default.nix4
3 files changed, 19 insertions, 41 deletions
diff --git a/hosts/ahmed/configuration.nix b/hosts/ahmed/configuration.nix
index f95f449..f987686 100644
--- a/hosts/ahmed/configuration.nix
+++ b/hosts/ahmed/configuration.nix
@@ -20,8 +20,7 @@
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
- boot.loader.grub.device = "/dev/mmcblk0p3"; # FIXME: Do we need to specify GRUB device?
- boot.loader.efi.canTouchEfiVariables = false;
+ boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.cleanOnBoot = true;
@@ -88,19 +87,6 @@
firewall.IPv4Whitelist = [metadata.hosts.muhammed.ipAddress];
};
- # Use as main driver temporarily.
- # modules.graphics.enable = true;
-
- services.disable-screen = {
- enable = true;
-
- # The path to the device.
- device-path = "/sys/class/backlight/intel_backlight";
-
- # The systemd device unit which corresponds to `device-path`.
- device-unit = "sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\\x2deDP\\x2d1-intel_backlight.device";
- };
-
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
diff --git a/hosts/ahmed/hardware-configuration.nix b/hosts/ahmed/hardware-configuration.nix
index 48a2786..6899cd3 100644
--- a/hosts/ahmed/hardware-configuration.nix
+++ b/hosts/ahmed/hardware-configuration.nix
@@ -1,41 +1,33 @@
# 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")
- ];
+{ config, lib, pkgs, modulesPath, ... }:
- boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci"];
- boot.initrd.kernelModules = [];
- boot.kernelModules = ["kvm-intel"];
- boot.extraModulePackages = [];
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
- fileSystems."/" = {
- device = "/dev/disk/by-label/nixos"; #"/dev/disk/by-uuid/a51aa876-0ba2-437f-b2fd-04ef18bdea79";
- fsType = "ext4";
- };
+ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-intel" ];
+ boot.extraModulePackages = [ ];
- fileSystems."/boot" = {
- device = "/dev/disk/by-label/boot";
- fsType = "vfat";
- };
+ fileSystems."/" =
+ { device = "/dev/disk/by-uuid/125d04f6-b18f-42d2-a55f-8c05ce766244";
+ fsType = "ext4";
+ };
- swapDevices = [{device = "/dev/disk/by-label/swap";}];
+ swapDevices = [ ];
# 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.wlp1s0.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp0s31f6.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;
}
diff --git a/modules/nixos/disable-screen/default.nix b/modules/nixos/disable-screen/default.nix
index 4a07c39..638437a 100644
--- a/modules/nixos/disable-screen/default.nix
+++ b/modules/nixos/disable-screen/default.nix
@@ -5,7 +5,7 @@
config,
...
}: let
- inherit (lib) mkEnableOption mkOption types;
+ inherit (lib) mkEnableOption mkOption mkIf types;
cfg = config.services.disable-screen;
in {
@@ -25,7 +25,7 @@ in {
};
};
- config = {
+ config = mkIf cfg.enable {
# Disable sleep on lid close.
services.logind = let
lidSwitchAction = "ignore";