nixos/binfmt: run binfmt activation script after mounting /run

binfmt activation script creates /run/binfmt before mounting /run
when system activation.

To fix it I added dependency to specialfs to binfmt activation
script.
This commit is contained in:
Kazutoshi Noguchi 2021-07-06 17:12:28 +09:00
parent 8bc3e5aaea
commit bf22778585

View file

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkOption types optionalString;
inherit (lib) mkOption types optionalString stringAfter;
cfg = config.boot.binfmt;
@ -270,7 +270,7 @@ in {
environment.etc."binfmt.d/nixos.conf".source = builtins.toFile "binfmt_nixos.conf"
(lib.concatStringsSep "\n" (lib.mapAttrsToList makeBinfmtLine config.boot.binfmt.registrations));
system.activationScripts.binfmt = ''
system.activationScripts.binfmt = stringAfter [ "specialfs" ] ''
mkdir -p -m 0755 /run/binfmt
${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet config.boot.binfmt.registrations)}
'';