Merge hardware.nix

This commit is contained in:
monologiq 2025-12-24 16:10:21 +01:00
parent 7ff397a7c0
commit 95c39f896c
6 changed files with 36 additions and 55 deletions

View file

@ -10,4 +10,10 @@ sudo nixos-install --root /mnt --flake .#hermes
```bash ```bash
nix run nix-darwin/release-* -- switch --flake .#mercure nix run nix-darwin/release-* -- switch --flake .#mercure
``` ```
# TODO
1. Create a configuration path for the directory `config`
2. Create `mkSystem` that:
1. Inject `options.machine`
2. Auto-import the related configurations

View file

@ -9,18 +9,24 @@
{ {
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
./persephone/hardware.nix
./persephone/networking.nix ./persephone/networking.nix
../profiles/minimal.linux.nix ../profiles/minimal.linux.nix
../profiles/desktop.linux.nix ../profiles/desktop.linux.nix
]; ];
boot = { boot = {
blacklistedKernelModules = [
"spd5118"
];
extraModulePackages = [ ]; extraModulePackages = [ ];
kernelModules = [ "kvm-intel" ]; kernelModules = [
"i2c-dev"
"kvm-intel"
];
kernelPackages = pkgs.linuxPackages_6_17; kernelPackages = pkgs.linuxPackages_6_17;
kernelParams = [ "i915.enable_guc=3" ]; kernelParams = [ "i915.enable_guc=3" ];
}; };
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = [
"xhci_pci" "xhci_pci"
"thunderbolt" "thunderbolt"
@ -34,7 +40,7 @@
keyMap = "us"; keyMap = "us";
font = "${pkgs.terminus_font}/share/consolefonts/ter-v28b.psf.gz"; font = "${pkgs.terminus_font}/share/consolefonts/ter-v28b.psf.gz";
}; };
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
hardware.enableRedistributableFirmware = true; hardware.enableRedistributableFirmware = true;
@ -48,6 +54,8 @@
]; ];
}; };
hardware.i2c.enable = true;
hardware.nvidia = { hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
open = true; open = true;
@ -109,6 +117,11 @@
VDPAU_DRIVER = "va_gl"; VDPAU_DRIVER = "va_gl";
}; };
environment.systemPackages = with pkgs; [
i2c-tools
lm_sensors
];
nix.settings = { nix.settings = {
substituters = [ "https://cache.nixos-cuda.org" ]; substituters = [ "https://cache.nixos-cuda.org" ];
trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ]; trusted-public-keys = [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
@ -125,7 +138,13 @@
programs._1password.enable = true; programs._1password.enable = true;
services.hardware.openrgb = {
enable = true;
startupProfile = "off";
};
services.pipewire.enable = true; services.pipewire.enable = true;
services.udev.packages = [ pkgs.openrgb ];
services.xserver.videoDrivers = [ services.xserver.videoDrivers = [
"modesetting" "modesetting"

View file

@ -1,34 +0,0 @@
{ pkgs, ... }:
{
# I2C
environment.systemPackages = with pkgs; [
i2c-tools
lm_sensors
];
boot.kernelModules = [ "i2c-dev" ];
boot.blacklistedKernelModules = [
# The spd5118 driver is in conflict with openrgb by holding onto I2C adresses when using Kingston Fury DRAM.
# On boot, I need to access those i2c regions in other to poweroff the RGB lighting.
# Then, I manually enable the kernel module in any script.
# It's possible to let this module disabled, but I lose the ability to get temperature values for the DIMMs.
# https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/2557
"spd5118"
];
hardware.i2c.enable = true;
# OpenRGB
services.udev.packages = [ pkgs.openrgb ];
services.hardware.openrgb = {
enable = true;
startupProfile = "off";
};
system.activationScripts.openrgbOff = ''
mkdir -p /var/lib/OpenRGB
cp ${./off.orp} /var/lib/OpenRGB/off.orp
chmod 0644 /var/lib/OpenRGB/off.orp
'';
}

View file

@ -1,17 +0,0 @@
diff --git a/OpenRGB.pro b/OpenRGB.pro
index df7082b6..0022e5fa 100644
--- a/OpenRGB.pro
+++ b/OpenRGB.pro
@@ -588,9 +588,9 @@ contains(QMAKE_PLATFORM, linux) {
icon.files+=qt/org.openrgb.OpenRGB.png
metainfo.path=$$PREFIX/share/metainfo/
metainfo.files+=qt/org.openrgb.OpenRGB.metainfo.xml
- systemd_service.path=/etc/systemd/system
- systemd_service.files+=qt/openrgb.service
- INSTALLS += target desktop icon metainfo udev_rules systemd_service
+ # systemd_service.path=/etc/systemd/system
+ # systemd_service.files+=qt/openrgb.service
+ INSTALLS += target desktop icon metainfo udev_rules # systemd_service
}
#-----------------------------------------------------------------------------------------------#

View file

@ -101,4 +101,11 @@ in
pulse.enable = true; pulse.enable = true;
jack.enable = true; jack.enable = true;
}; };
system.activationScripts.openrgbOff =
mkIf (config.services.hardware.openrgb.startupProfile == "off") ''
mkdir -p /var/lib/OpenRGB
cp ${../config/openrgb/off.orp} /var/lib/OpenRGB/off.orp
chmod 0644 /var/lib/OpenRGB/off.orp
'';
} }