Fixes for work computer

This commit is contained in:
Emmet
2025-02-23 15:50:44 -06:00
parent d5a354a0df
commit 1b6bdc9790
4 changed files with 30 additions and 50 deletions

View File

@@ -10,7 +10,7 @@
# hardware
cachy.enable = true;
bluetooth.enable = true;
tlp.enable = true;
tlp.enable = false; # intel doesn't work with tlp
printing.enable = true;
# software
@@ -44,6 +44,10 @@
theme = "alph";
};
};
home-manager.users.emmet.userSettings = {
name = "Emmet";
};
};
}

View File

@@ -1,13 +1,18 @@
# 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, inputs, ... }:
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
services.fstrim.enable = true;
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
@@ -17,57 +22,15 @@
enable32Bit = lib.mkDefault true;
};
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "vmd" "ahci" "nvme" "usbhid" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
# my stupid usb hub crashes systemct suspend half of the time now
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Sleep_hooks
systemd.services.root-suspend = {
enable = true;
description = "Root systemd suspend prehook";
unitConfig = {
Description = "Root systemd suspend prehook";
Before = "sleep.target";
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a off";
};
wantedBy = [ "sleep.target" ];
};
systemd.services.root-resume = {
enable = true;
description = "Root systemd suspend posthook";
unitConfig = {
Description = "Root systemd suspend posthook";
After = "suspend.target";
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a on";
};
wantedBy = [ "suspend.target" ];
};
services.btrfs.autoScrub = {
enable = true;
interval = "weekly";
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/ca98a0cc-4a50-4e28-84e5-0dddcbfea155";
fsType = "btrfs";
options = [ "noatime,compress-force=zstd:2,discard=async,commit=120,clear_cache,space_cache=v2,subvol=@" ];
{ device = "/dev/disk/by-uuid/548f7030-af4c-412a-b2ed-d842337aa336";
fsType = "ext4";
};
boot.loader.efi.efiSysMountPoint = "/boot";
boot.initrd.luks.devices."luks-9c74f9e5-41c3-4ba6-8a87-059dbcd4e2b3".device = "/dev/disk/by-uuid/9c74f9e5-41c3-4ba6-8a87-059dbcd4e2b3";
boot.initrd.luks.devices."luks-50f310ae-545b-4f09-84b6-e69b5ecacaae".device = "/dev/disk/by-uuid/50f310ae-545b-4f09-84b6-e69b5ecacaae";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4898-D64F";
{ device = "/dev/disk/by-uuid/F691-DA8C";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};

View File

@@ -40,6 +40,10 @@
bluetooth.enable = true;
};
home.sessionVariables = lib.mkIf config.userSettings.hyprland.enable {
AQ_DRM_DEVICES = lib.mkForce "/dev/dri/card0";
};
wayland.windowManager.hyprland = lib.mkIf config.userSettings.hyprland.enable {
settings = {
bind = [
@@ -61,5 +65,11 @@
};
};
services.fnott.settings = {
main = {
output = "eDP-1"; # notifications only on main display
};
};
};
}

View File

@@ -29,7 +29,7 @@ in
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
WLR_DRM_DEVICES = "/dev/dri/card2:/dev/dri/card1";
AQ_DRM_DEVICES = "/dev/dri/card2:/dev/dri/card1";
GDK_BACKEND = "wayland,x11,*";
QT_QPA_PLATFORM = "wayland;xcb";
QT_QPA_PLATFORMTHEME = lib.mkForce "qt5ct";
@@ -51,6 +51,9 @@ in
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
plugins = [ ];
settings = {
env = [
"AQ_DRM_DEVICES,${config,home.sessionVariables.AQ_DRM_DEVICES}"
];
exec-once = [
"hyprctl setcursor ${config.gtk.cursorTheme.name} ${builtins.toString config.gtk.cursorTheme.size}"
"hyprpaper"