Skip to content

Commit

Permalink
Add luminance and external monitor kernel modules
Browse files Browse the repository at this point in the history
  • Loading branch information
natsukagami committed Dec 12, 2024
1 parent 56a8c33 commit ea33109
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 12 deletions.
20 changes: 10 additions & 10 deletions modules/common/linux/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ let
};
};

graphics = { config, ... }: {
hardware =
if config.system.nixos.release == "24.05" then {
opengl.enable = true;
opengl.driSupport32Bit = true;
} else {
graphics.enable = true;
graphics.enable32Bit = true;
};
graphics = { config, pkgs, ... }: {
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
# Monitor backlight
hardware.i2c.enable = true;
services.ddccontrol.enable = true;
environment.systemPackages = [ pkgs.luminance pkgs.ddcutil ];
};

accounts = { pkgs, ... }: mkIf (config.common.linux.enable && !pkgs.stdenv.isAarch64) {
Expand Down Expand Up @@ -88,7 +86,7 @@ let
enable = true;
# defaults (no need to be set unless modified)
quantum = 32;
rate = 48000;
rate = 44100;
};
security.rtkit.enable = true;

Expand Down Expand Up @@ -240,6 +238,8 @@ in
"wheel" # Enable ‘sudo’ for the user.
"plugdev" # Enable openrazer-daemon privileges
"audio"
"video"
"input"
];
shell = pkgs.fish;
};
Expand Down
2 changes: 1 addition & 1 deletion nki-home/audio/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ config, pkgs, lib, ... }: {
environment.etc = {
"wireplumber/main.lua.d/51-sdac.lua".source = ./sdac.lua;
"wireplumber/wireplumber.conf.d/51-sdac.conf".source = ./sdac.conf.json;
};
}
19 changes: 19 additions & 0 deletions nki-home/audio/sdac.conf.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
]

2 changes: 1 addition & 1 deletion nki-home/audio/sdac.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ rule = {
},
apply_properties = {
["audio.format"] = "S24_3LE",
["audio.rate"] = 96000,
["audio.rate"] = 44100,
["api.alsa.period-size"] = 2,
["api.alsa.headroom"] = 0,
["api.alsa.disable-batch"] = true
Expand Down
10 changes: 10 additions & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ let
builtins.seq
(final.lib.assertMsg (prev.vikunja.version == "0.24.5") "Vikunja probably doesn't need custom versions anymore")
(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: {
Expand Down Expand Up @@ -125,3 +133,5 @@ in
# Bug fixes
] # we assign the overlay created before to the overlays of nixpkgs.



0 comments on commit ea33109

Please sign in to comment.