Rebase to flake parts #4

This commit is contained in:
2026-05-01 17:25:23 -03:00
parent 2c576715de
commit 064ba9655a
11 changed files with 2019 additions and 0 deletions
@@ -0,0 +1,92 @@
# Monitor layout for 14900k (ported from NixOS-New `hosts/clients/14900k/home.nix`).
# Niri: `chiasson.desktop.niri.extraSettings.extraConfig` (wrapper-modules / system package).
# Hyprland: `chiasson.desktop.hyprland.settings` (merged in HM when `chiasson.desktop.hyprland.enable`).
#TODO[epic=Moderate] Clean this up, move to host's configuration.nix.
{ config, lib, ... }:
let
gpuPassthrough = config.chiasson.system.vm.gpuPassthrough.enable;
in
{
chiasson.desktop.niri.extraSettings.extraConfig =
if gpuPassthrough then
''
output "DP-1" {
mode "2560x1080@144"
scale 1.0
position x=1920 y=0
focus-at-startup
}
output "HDMI-A-2" {
mode "1920x1080@60"
scale 1.0
position x=0 y=0
}
''
else
''
output "DP-2" {
mode "2560x1080@144"
scale 1.0
position x=0 y=0
focus-at-startup
}
output "HDMI-A-3" {
mode "1920x1080@60"
scale 1.0
position x=-1920 y=0
}
output "DP-4" {
mode "1920x1080@144"
scale 1.0
position x=0 y=-1080
}
'';
chiasson.desktop.hyprland.settings = lib.mkIf config.chiasson.desktop.hyprland.enable (
let
monitorList =
if gpuPassthrough then
[
"DP-1, 2560x1080@144, 0x0, 1"
"HDMI-A-2, 1920x1080@60, auto-up, 1"
]
else
[
"DP-2, 2560x1080@144, 0x0, 1"
"DP-4, 1920x1080@144, 0x-1080, 1"
"HDMI-A-3, 1920x1080@60, -1920x0, 1"
];
workspaceList =
if gpuPassthrough then
[
"1, monitor:DP-1, default:true"
"2, monitor:DP-1"
"3, monitor:DP-1"
"4, monitor:DP-1"
"5, monitor:HDMI-A-2, default:true"
"6, monitor:HDMI-A-2"
"7, monitor:HDMI-A-2"
"8, monitor:HDMI-A-2"
"9, monitor:DP-1"
]
else
[
"1, monitor:DP-3, default:true"
"2, monitor:DP-3"
"3, monitor:DP-3"
"4, monitor:Unknown-2, default:true"
"5, monitor:Unknown-2"
"6, monitor:Unknown-2"
"7, monitor:DP-4"
"8, monitor:DP-4"
"9, monitor:DP-4"
];
in
{
monitor = lib.mkBefore monitorList;
workspace = workspaceList;
}
);
}
+26
View File
@@ -0,0 +1,26 @@
# NVIDIA for host desktop; when `chiasson.system.vm.gpuPassthrough` is enabled, drop NVIDIA for VFIO (port later).
{ config, lib, pkgs, ... }:
let
passthrough = config.chiasson.system.vm.gpuPassthrough.enable;
in
{
boot.kernelParams = [ "snd_hda_core.gpu_bind=0" ];
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
services.xserver.videoDrivers = if passthrough then [ "modesetting" ] else [ "nvidia" ];
hardware.nvidia =
if passthrough then
lib.mkForce { }
else {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# Needed for `docker compose` GPU passthrough (e.g. `--gpus all` / DEVICE=gpu).
hardware.nvidia-container-toolkit.enable = !passthrough;
}
@@ -0,0 +1,12 @@
# Logitech Unifying / Bolt receivers; Keychron VIA/VIAL on hidraw.
{ ... }:
{
hardware.logitech.wireless.enable = true;
services.udev.extraRules = ''
# Keychron VIA/VIAL on hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="3434", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
# PS5 DualSense & DualSense Edge controllers over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6|0df2", MODE="0660", TAG+="uaccess"
'';
}
@@ -0,0 +1,14 @@
{ ... }: {
#TODO[epic=Moderate] Clean this up, move to host's configuration.nix.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
powerManagement.cpuFreqGovernor = "performance";
hardware.enableRedistributableFirmware = true;
hardware.enableAllFirmware = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
system.stateVersion = "25.11";
}