Cleaning up

This commit is contained in:
Paul-Mathias Logue 2025-12-14 00:23:16 +01:00
parent 45992b10ae
commit a4765b4fee
7 changed files with 84 additions and 54 deletions

View file

@ -4,10 +4,8 @@
inputs = { inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*"; nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
lanzaboote = { lanzaboote.url = "github:nix-community/lanzaboote/v1.0.0";
url = "github:nix-community/lanzaboote/v1.0.0"; lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
apple-fonts.url = "github:Lyndeno/apple-fonts.nix"; apple-fonts.url = "github:Lyndeno/apple-fonts.nix";
apple-fonts.inputs.nixpkgs.follows = "nixpkgs"; apple-fonts.inputs.nixpkgs.follows = "nixpkgs";
@ -40,11 +38,14 @@
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { inherit inputs; }; specialArgs = { inherit inputs; };
modules = [ modules = [
{ nixpkgs.overlays = [ self.overlays.default ]; }
./machines/hermes ./machines/hermes
./users/pml.nix ./users/pml.nix
]; ];
}; };
overlays.default = import ./overlays;
devShells = forEachSupportedSystem ( devShells = forEachSupportedSystem (
{ pkgs, system }: { pkgs, system }:
{ {

View file

@ -1,4 +1,9 @@
{ lib, pkgs, ... }: {
inputs,
lib,
pkgs,
...
}:
{ {
imports = [ imports = [
@ -9,6 +14,7 @@
./audio.nix ./audio.nix
./bluetooth.nix ./bluetooth.nix
./networking.nix ./networking.nix
./hardware.nix
]; ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
@ -38,30 +44,10 @@
# You can use https://search.nixos.org/ to find more packages (and options). # You can use https://search.nixos.org/ to find more packages (and options).
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
wget wget
sbctl
alacritty alacritty
fuzzel fuzzel
libva-utils
firefox firefox
(openrgb.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
owner = "CalcProgrammer1";
repo = "OpenRGB";
rev = "release_candidate_1.0rc2";
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
};
patches = [
./remove_systemd_service.patch
];
postPatch = ''
patchShebangs scripts/build-udev-rules.sh
substituteInPlace scripts/build-udev-rules.sh \
--replace-fail /usr/bin/env "${pkgs.coreutils}/bin/env"
'';
version = "1.0rc2";
}))
adwaita-icon-theme adwaita-icon-theme
i2c-tools
]; ];
fonts.fontconfig = { fonts.fontconfig = {
@ -75,7 +61,6 @@
rgba = "rgb"; rgba = "rgb";
lcdfilter = "default"; lcdfilter = "default";
}; };
defaultFonts = { defaultFonts = {
serif = [ serif = [
"SF Pro" "SF Pro"
@ -145,11 +130,6 @@
polkitPolicyOwners = [ "pml" ]; polkitPolicyOwners = [ "pml" ];
}; };
#services.hardware.openrgb.enable = true;
services.udev.packages = [ pkgs.openrgb ];
boot.kernelModules = [ "i2c-dev" ];
hardware.i2c.enable = true;
environment.etc = { environment.etc = {
"1password/custom_allowed_browsers" = { "1password/custom_allowed_browsers" = {
text = '' text = ''

View file

@ -1,7 +1,5 @@
{ {
config, config,
inputs,
lib,
pkgs, pkgs,
... ...
}: }:

View file

@ -0,0 +1,43 @@
{ pkgs, ... }:
let
no-rgb = pkgs.writeScriptBin "no-rgb" ''
#!/bin/sh
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --list-devices | grep -E '^[0-9]+: ' | wc -l)
for i in $(seq 0 $(($NUM_DEVICES - 1))); do
${pkgs.openrgb}/bin/openrgb --device $i --mode static --color 000000
done
'';
in
{
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;
systemd.services.no-rgb = {
description = "no-rgb";
serviceConfig = {
ExecStart = "${no-rgb}/bin/no-rgb";
Type = "oneshot";
};
after = [ "openrgb.service" ];
requires = [ "openrgb.service" ];
wantedBy = [ "multi-user.target" ];
};
}

3
overlays/default.nix Normal file
View file

@ -0,0 +1,3 @@
final: prev: {
openrgb = final.callPackage ./openrgb/package.nix { openrgb = prev.openrgb; };
}

View file

@ -1,20 +0,0 @@
final: prev: {
openrgb = prev.openrgb.overrideAttrs (old: {
src = final.fetchFromGitLab {
owner = "CalcProgrammer1";
repo = "OpenRGB";
rev = "release_candidate_1.0rc2";
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
};
patches = [
./remove_systemd_service.patch
];
postPatch = ''
patchShebangs scripts/build-udev-rules.sh
substituteInPlace scripts/build-udev-rules.sh \
--replace-fail /usr/bin/env "${final.coreutils}/bin/env"
'';
version = "1.0rc2";
});
}

View file

@ -0,0 +1,25 @@
{
coreutils,
fetchFromGitLab,
openrgb,
...
}:
openrgb.overrideAttrs (old: {
version = "1.0rc2";
src = fetchFromGitLab {
owner = "CalcProgrammer1";
repo = "OpenRGB";
rev = "release_candidate_1.0rc2";
sha256 = "vdIA9i1ewcrfX5U7FkcRR+ISdH5uRi9fz9YU5IkPKJQ=";
};
patches = [
./remove_systemd_service.patch
];
postPatch = ''
patchShebangs scripts/build-udev-rules.sh
substituteInPlace scripts/build-udev-rules.sh \
--replace-fail /usr/bin/env "${coreutils}/bin/env"
'';
})