Files
dotfiles/config/hosts/aspects/doloro-laptop/host.nix
T
2026-08-24 10:39:58 +01:00

253 lines
8.3 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.
{
den,
modules,
__findFile,
inputs,
lib,
...
}:
{
den.aspects.laptop = {
includes = [
modules.nix
modules.tuigreet
# <modules/common/laptop-power-management>
modules.fonts
modules.surface-patches
modules.nikpkgs
modules.auto-cpufreq
modules.tlp
# (modules.tdp {
# batt = {
# cpu = {
# long-term = 13;
# short-term = 7;
# };
# mmio = {
# long-term = 10;
# short-term = 7;
# };
# };
# ac = {
# cpu = {
# long-term = 120;
# short-term = 120;
# };
# mmio = {
# long-term = 40;
# short-term = 20;
# };
# };
# })
];
nixos =
{ pkgs, config, ... }:
{
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.upower.enable = true;
networking.hostName = "doloro-nixos-laptop"; # Define your hostname.
# security.rtkit.enable = true;
# Configure network connections interactively with nmcli or nmtui.
networking.networkmanager.enable = true;
boot.initrd = {
systemd = {
enable = true;
emergencyAccess = true;
tpm2.enable = false;
};
};
systemd.units."dev-tpm0.device".enable = false;
systemd.units."dev-tpmrm0.device".enable = false;
# Set your time zone.
# time.timeZone = "Europe/London";
services.automatic-timezoned.enable = true;
networking.wireless.iwd.enable = false;
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://cache.nixos.org/"
"https://attic.scug.io/pkgs"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"pkgs:+sRbfiZMMX5R3PuAPtIRz/emowDoGZNpozibrnrAvuc="
];
experimental-features = [
"flakes"
"nix-command"
];
trusted-users = [
"doloro"
];
};
# services.gnome.gnome-keyring.enable = true;
nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
};
hardware = {
# Qualcomm Adreno X1-85 (freedreno/turnip) + IRIS need the qcom
# firmware blobs (gen70500_sqe.fw / gmu.bin / zap.mbn). On most
# Snapdragon X laptops these must be extracted from Windows unless
# shipped by linux-firmware (e.g. ThinkPad T14s Gen 6).
firmware = [ pkgs.linux-firmware ];
graphics = {
enable = true;
# Adreno has no userspace driver package to add here: GL/Vulkan
# (freedreno/turnip) come from mesa (auto-included), and IRIS video
# has no usable VA-API backend yet, so extraPackages stays empty.
extraPackages = with pkgs; [
];
};
};
# NOTE: removed LIBVA_DRIVER_NAME="iHD" — that forces the Intel media
# driver and is wrong on Qualcomm Adreno (aarch64).
# services.fwupd = {
# enable = true;
# };
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "prohibit-password";
};
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7"
];
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# Enable the X11 windowing system.
services.xserver.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.libinput.enable = true;
# boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
# Define a user account. Don't forget to set a password with passwd.
# users.users.doloro = {
# isNormalUser = true;
# shell = pkgs.fish;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = with pkgs; [
# tree
# ];
# hashedPasswordFile = config.sops.secrets."doloro-hashed_password".path;
# openssh.authorizedKeys.keys = [
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBaa6Z5qtBSLEz+A4fQGYPfkOISsRQlmKkVbcx2zxML7" # pc public key
# ];
# # initialPassword = "sex";
# };
users.users.root = {
initialPassword = "meowmeowmeow";
};
users.mutableUsers = false;
services.system76-scheduler.enable = false;
powerManagement = {
enable = true;
# powertop.enable = true;
};
boot.kernelParams = [
# "mem_sleep_default=deep"
# "i915.fastboot=1"
# "i915.modeset=1"
"ahci.mobile_lpm_policy=1"
# "intel_idle.max_cstate=10"
"processor.max_cstate=10"
"pci=noaer"
"quiet"
"splash"
# "idle=halt"
];
boot.binfmt.emulatedSystems = [
"x86_64-linux"
];
services.logind.settings.Login = {
# HandleLidSwitch = "suspend";
# HandleLidSwitchExternalPower = "suspend";
# HandleLidSwitchDocked = "ignore";
};
# systemd.sleep.extraConfig = ''
# HibernateDelaySec=30min
# SuspendEstimationSec=120
# '';
# programs.firefox.enable = true;
# List packages installed in system profile.
# You can use https://search.nixos.org/ to find more packages (and options).
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# git
# wget
# # tlp-pd
# brightnessctl
# nvtopPackages.intel
# seahorse
# ];
# 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:
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.11"; # Did you read the comment?
};
};
}