diff --git a/modules/nixos/common/armv7l.nix b/modules/nixos/common/armv7l.nix new file mode 100644 index 000000000..f3815340f --- /dev/null +++ b/modules/nixos/common/armv7l.nix @@ -0,0 +1,30 @@ +{ + 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 = [ + { + patch = pkgs.fetchpatch { + name = "compat_uts_machine.patch"; + 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" ]; + }; +} diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix index 095f7cd02..a98f81602 100644 --- a/modules/nixos/common/default.nix +++ b/modules/nixos/common/default.nix @@ -9,6 +9,7 @@ ../../shared/known-hosts.nix ../../shared/nix-daemon.nix ./agenix.nix + ./armv7l.nix ./builder.nix ./security.nix ./sops-nix.nix