Skip to content

Commit

Permalink
modules/nixos: add armv7l kernel personality patch
Browse files Browse the repository at this point in the history
  • Loading branch information
zowoq committed Dec 9, 2024
1 parent 25e81d2 commit 0a2b92e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions modules/nixos/common/armv7l.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
config,
lib,
pkgs,
...
}:
# https://github.com/NixOS/aarch64-build-box/pull/133
{
config =
lib.mkIf
(
lib.hasPrefix "build" config.networking.hostName
&& pkgs.stdenv.hostPlatform.system == "aarch64-linux"
)
{
boot.kernelParams = [ "compat_uts_machine=armv7l" ];

boot.kernelPatches =
let
name = "compat_uts_machine";
in
[
{
inherit name;
patch = pkgs.fetchpatch {
inherit name;
url = "https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy/patch/?id=c1da50fa6eddad313360249cadcd4905ac9f82ea";
hash = "sha256-357+EzMLLt7IINdH0ENE+VcDXwXJMo4qiF/Dorp2Eyw=";
};
}
];

nix.settings.extra-platforms = [ "armv7l-linux" ];
};
}
1 change: 1 addition & 0 deletions modules/nixos/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
../../shared/known-hosts.nix
../../shared/nix-daemon.nix
./agenix.nix
./armv7l.nix
./builder.nix
./security.nix
./sops-nix.nix
Expand Down

0 comments on commit 0a2b92e

Please sign in to comment.