Add luminance and external monitor kernel modules

This commit is contained in:
Natsu Kagami 2024-12-12 01:49:42 +01:00
parent 56a8c33f9c
commit ea331093bb
Signed by: nki
GPG key ID: 55A032EB38B49ADB
5 changed files with 41 additions and 12 deletions

View file

@ -26,15 +26,13 @@ let
}; };
}; };
graphics = { config, ... }: { graphics = { config, pkgs, ... }: {
hardware = hardware.graphics.enable = true;
if config.system.nixos.release == "24.05" then { hardware.graphics.enable32Bit = true;
opengl.enable = true; # Monitor backlight
opengl.driSupport32Bit = true; hardware.i2c.enable = true;
} else { services.ddccontrol.enable = true;
graphics.enable = true; environment.systemPackages = [ pkgs.luminance pkgs.ddcutil ];
graphics.enable32Bit = true;
};
}; };
accounts = { pkgs, ... }: mkIf (config.common.linux.enable && !pkgs.stdenv.isAarch64) { accounts = { pkgs, ... }: mkIf (config.common.linux.enable && !pkgs.stdenv.isAarch64) {
@ -88,7 +86,7 @@ let
enable = true; enable = true;
# defaults (no need to be set unless modified) # defaults (no need to be set unless modified)
quantum = 32; quantum = 32;
rate = 48000; rate = 44100;
}; };
security.rtkit.enable = true; security.rtkit.enable = true;
@ -240,6 +238,8 @@ in
"wheel" # Enable sudo for the user. "wheel" # Enable sudo for the user.
"plugdev" # Enable openrazer-daemon privileges "plugdev" # Enable openrazer-daemon privileges
"audio" "audio"
"video"
"input"
]; ];
shell = pkgs.fish; shell = pkgs.fish;
}; };

View file

@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
environment.etc = { environment.etc = {
"wireplumber/main.lua.d/51-sdac.lua".source = ./sdac.lua; "wireplumber/wireplumber.conf.d/51-sdac.conf".source = ./sdac.conf.json;
}; };
} }

View file

@ -0,0 +1,19 @@
monitor.alsa.rules = [
{
matches = [
{
device.name = "alsa_output.usb-Grace_Design_SDAC-00.*"
}
]
actions = {
update-props = {
# audio.format = "S24_3LE"
audio.rate = 88200
api.alsa.period-size = 2
api.alsa.headroom = 0
api.alsa.disable-batch = true
}
}
}
]

View file

@ -6,7 +6,7 @@ rule = {
}, },
apply_properties = { apply_properties = {
["audio.format"] = "S24_3LE", ["audio.format"] = "S24_3LE",
["audio.rate"] = 96000, ["audio.rate"] = 44100,
["api.alsa.period-size"] = 2, ["api.alsa.period-size"] = 2,
["api.alsa.headroom"] = 0, ["api.alsa.headroom"] = 0,
["api.alsa.disable-batch"] = true ["api.alsa.disable-batch"] = true

View file

@ -75,6 +75,14 @@ let
builtins.seq builtins.seq
(final.lib.assertMsg (prev.vikunja.version == "0.24.5") "Vikunja probably doesn't need custom versions anymore") (final.lib.assertMsg (prev.vikunja.version == "0.24.5") "Vikunja probably doesn't need custom versions anymore")
(final.callPackage ./packages/common/vikunja.nix { }); (final.callPackage ./packages/common/vikunja.nix { });
luminance = prev.luminance.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ final.wrapGAppsHook ];
buildInputs = attrs.buildInputs ++ [ final.glib ];
postInstall = attrs.postInstall + ''
glib-compile-schemas $out/share/glib-2.0/schemas
'';
});
}; };
overlay-libs = final: prev: { overlay-libs = final: prev: {
@ -125,3 +133,5 @@ in
# Bug fixes # Bug fixes
] # we assign the overlay created before to the overlays of nixpkgs. ] # we assign the overlay created before to the overlays of nixpkgs.