dotfiles/system/syl/configuration.nix
2023-01-06 15:02:07 -06:00

113 lines
3.9 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ lib, config, pkgs, callPackage, ... }:
{
imports =
[
./hardware-configuration.nix
/etc/nixos/cachix.nix
../../pkgs/base-packages.nix
../../pkgs/desktop-packages.nix
../../modules/base.nix
../../modules/emacs.nix
../../modules/desktop.nix
];
networking.hostName = "syl"; # Define your hostname.
boot.initrd.kernelModules = [ "i915" ];
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.acpilight.enable = lib.mkDefault true;
networking.interfaces.wlp170s0.useDHCP = true;
hardware.uinput.enable = true;
hardware.bluetooth.enable = true;
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
services.xserver.videoDrivers = ["intel"];
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
libvdpau-va-gl
];
};
systemd.services.display-manager = {
wants = [ "systemd-user-sessions.service" "multi-user.target" "network-online.target" ];
after = [ "systemd-user-sessions.service" "multi-user.target" "network-online.target" ];
};
# Enable fingerprint
services.fprintd.enable = true;
# Some other things
services.thermald.enable = true;
services.power-profiles-daemon.enable = false;
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC="performance";
CPU_SCALING_GOVERNOR_ON_BAT="powersave";
CPU_ENERGY_PERF_POLICY_ON_AC="balance_performance";
CPU_ENERGY_PERF_POLICY_ON_BAT="power";
PCIE_ASPM_ON_AC="default";
PCIE_ASPM_ON_BAT="powersupersave";
SCHED_POWERSAVE_ON_AC=0;
SCHED_POWERSAVE_ON_BAT=1;
START_CHARGE_THRESH_BAT1=70;
STOP_CHARGE_THRESH_BAT1=80;
USB_ALLOWLIST="32ac:0002";
};
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.chris = {
isNormalUser = true;
extraGroups = [ "adbusers" "wheel" "networkmanager" "input" "uinput" ];
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
services.locate = {
enable = true;
locate = pkgs.plocate;
localuser = null;
interval = "hourly";
prunePaths = [ "/tmp" "/nix/store" "/nix/var/log/nix" "/etc" "/bin" "/boot" "/usr" "/var" "/run" "/srv" "/sys" "/root" "/proc" "/opt" "/dev" "/home/chris/.emacs.d" "/home/chris/.config" "/home/chris/.nix-profile" "/home/chris/.profile" "/home/chris/dev/nixpkgs" "/home/chris/.cache" "/home/chris/.local" "/home/chris/.dotemacs" "/home/chris/.cargo" "/home/chris/.mozilla" "/home/chris/.var" "/home/chris/.dotfiles" "/home/chris/.dbus" "/home/chris/.android" "/var/lib"];
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# 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. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.11"; # Did you read the comment?
}