Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions configs/hw/signed-kmods.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Out-of-tree kernel modules installed through the kernel's modules_install,
# imported (not as a module) by the hardware configs that load them.
#
# Since NixOS/nixpkgs#571181 the kernel signs modules deterministically and
# the module aggregator (pkgs/os-specific/linux/kmod/aggregator.nix) expects
# a <module>.ko.cer next to every out-of-tree module. modules_install writes
# it; these packages' own installPhase copies the bare .ko, so the system
# build fails with "cat: ...ko.cer: No such file or directory".
#
# Drop each entry once nixpkgs installs it that way:
# - acpi_call: NixOS/nixpkgs#575394
# - framework-laptop-kmod: NixOS/nixpkgs#575818 (merged)
# - tp_smapi: no upstream fix yet
{ lib, kernelPackages }:
let
inherit (kernelPackages) kernel kernelModuleMakeFlags;
modulesInstallFlags = dir: [
"INSTALL_MOD_PATH=${placeholder "out"}"
"INSTALL_MOD_DIR=${dir}"
"DEPMOD=true"
];
in
{
# As in NixOS/nixpkgs#575394: its Makefile's install target runs
# modules_install.
acpi_call = kernelPackages.acpi_call.overrideAttrs (old: {
makeFlags = old.makeFlags ++ modulesInstallFlags "misc";
installPhase = null;
postInstall = ''
install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
'';
});

# As in NixOS/nixpkgs#575818.
framework-laptop-kmod = kernelPackages.framework-laptop-kmod.overrideAttrs (old: {
makeFlags = old.makeFlags ++ modulesInstallFlags "extra";
installPhase = null;
installTargets = [ "modules_install" ];
});

# Same place as before. hdaps.ko keeps its old file name hdapsd.ko:
# modprobe goes by file name, so it doesn't shadow the in-tree hdaps
# driver.
tp_smapi = kernelPackages.tp_smapi.overrideAttrs {
installPhase = ''
runHook preInstall

make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build M="$PWD" \
${lib.escapeShellArgs (kernelModuleMakeFlags ++ modulesInstallFlags "kernel/drivers/firmware")} \
modules_install
cd $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware
for f in hdaps.ko*; do
mv "$f" "hdapsd''${f#hdaps}"
done

runHook postInstall
'';
};
}
10 changes: 8 additions & 2 deletions configs/hw/x220.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
pkgs,
...
}:
let
kmods = import ./signed-kmods.nix {
inherit lib;
inherit (config.boot) kernelPackages;
};
in
{
# Hardware configuration from krebs/stockholm x220.nix, with updated package names
networking.wireless.enable = lib.mkDefault true;
Expand All @@ -30,8 +36,8 @@
"usb_storage"
];
extraModulePackages = [
config.boot.kernelPackages.tp_smapi
config.boot.kernelPackages.acpi_call
kmods.tp_smapi
kmods.acpi_call
];
kernelModules = [
"kvm-intel"
Expand Down
2 changes: 2 additions & 0 deletions configs/monitoring/agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config,
lib,
pkgs,
self,
...
}:
let
Expand Down Expand Up @@ -67,6 +68,7 @@ in
config.services.vector = {
enable = true;
journaldAccess = true;
package = self.packages.${pkgs.stdenv.hostPlatform.system}.vector;
settings = {
data_dir = "/var/lib/vector";

Expand Down
2 changes: 1 addition & 1 deletion configs/orca/server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ in
];
packages = [
orca
self.packages.${pkgs.system}.omp
pkgs.omp
# GitHub issues/PRs in the work item lists.
pkgs.gh
];
Expand Down
4 changes: 2 additions & 2 deletions configs/services/radio/tts.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, self, ... }:
let
model = pkgs.runCommand "model" { } ''
mkdir -p $out
Expand Down Expand Up @@ -31,7 +31,7 @@ let
fi
filename=$(printf '%04d' $offset).wav
echo "$line" |
${pkgs.piper-tts}/bin/piper \
${self.packages.${pkgs.stdenv.hostPlatform.system}.piper-tts}/bin/piper \
--model ${model}/model.onnx \
-s "$SPEAKER" \
-f "$OUTPUT"/"$filename" >/dev/null
Expand Down
66 changes: 33 additions & 33 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion machines/barnacle/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
self.packages.${pkgs.system}.s

self.packages.${pkgs.system}.secretive
self.packages.${pkgs.system}.omp
pkgs.omp
self.packages.${pkgs.system}.browser-mcp

# zsh dependencies
Expand Down
2 changes: 1 addition & 1 deletion machines/coaxmetal/hermes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let
# Contract: hermes writes the reply text to $1 and expects audio at $2.
hermes-tts = pkgs.writeShellApplication {
name = "hermes-tts";
runtimeInputs = [ pkgs.piper-tts ];
runtimeInputs = [ self.packages.${pkgs.stdenv.hostPlatform.system}.piper-tts ];
text = ''
piper --model ${piperVoice}/model.onnx --output-file "$2" < "$1"
'';
Expand Down
3 changes: 2 additions & 1 deletion machines/daedalus/config.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
self,
lib,
pkgs,
...
Expand Down Expand Up @@ -43,7 +44,7 @@
chromium
networkmanagerapplet
libreoffice
audacity
self.packages.${pkgs.stdenv.hostPlatform.system}.audacity
zathura
wine
vlc
Expand Down
12 changes: 9 additions & 3 deletions machines/daedalus/physical.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{ config, ... }:
{ config, lib, ... }:
let
kmods = import ../../configs/hw/signed-kmods.nix {
inherit lib;
inherit (config.boot) kernelPackages;
};
in
{
imports = [
./config.nix
Expand Down Expand Up @@ -48,8 +54,8 @@
"usb_storage"
];
extraModulePackages = [
config.boot.kernelPackages.tp_smapi
config.boot.kernelPackages.acpi_call
kmods.tp_smapi
kmods.acpi_call
];
kernelModules = [
"acpi_call"
Expand Down
21 changes: 19 additions & 2 deletions machines/ignavia/physical.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
self,
config,
lib,
modulesPath,
pkgs,
...
Expand Down Expand Up @@ -41,8 +43,23 @@

hardware.graphics.enable = true;
hardware.acpilight.enable = true;
# DDC/CI: expose /dev/i2c-* so ddcutil can drive external monitor brightness
boot.kernelModules = [ "i2c-dev" ];
boot.kernelModules = [
# DDC/CI: expose /dev/i2c-* so ddcutil can drive external monitor brightness
"i2c-dev"
# what hardware.framework.enableKmod loads, see below
"cros_ec"
"cros_ec_lpcs"
];

# nixos-hardware's framework-laptop-kmod lacks the module certificate the
# module aggregator needs, see configs/hw/signed-kmods.nix.
hardware.framework.enableKmod = false;
boot.extraModulePackages = [
(import ../../configs/hw/signed-kmods.nix {
inherit lib;
inherit (config.boot) kernelPackages;
}).framework-laptop-kmod
];

# Use latest kernel for better Strix Point GPU support. The MT7925 BT init
# regression fix (e3ac0d9f1a20) landed upstream in 7.0.10.
Expand Down
Loading
Loading