summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system/boot/binfmt.nix
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-01-21 01:19:31 +0000
committerGitHub <noreply@github.com>2021-01-21 01:19:31 +0000
commite5fef074d63de524cb40ebc609eabe51db90d80e (patch)
treee8fc60c5bcc0b8fef14d2923b515c52d27da714c /nixos/modules/system/boot/binfmt.nix
parent49d7c98041f2298b79b5118d816d7215c6a49524 (diff)
parent3617a771ca43a34e1b3a97f1bc046f7be2aac92a (diff)
Merge staging-next into staging
Diffstat (limited to 'nixos/modules/system/boot/binfmt.nix')
-rw-r--r--nixos/modules/system/boot/binfmt.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix
index 9eeae0c3ef44..5bcc95be324a 100644
--- a/nixos/modules/system/boot/binfmt.nix
+++ b/nixos/modules/system/boot/binfmt.nix
@@ -20,8 +20,14 @@ let
optionalString fixBinary "F";
in ":${name}:${type}:${offset'}:${magicOrExtension}:${mask'}:${interpreter}:${flags}";
- activationSnippet = name: { interpreter, ... }:
- "ln -sf ${interpreter} /run/binfmt/${name}";
+ activationSnippet = name: { interpreter, ... }: ''
+ rm -f /run/binfmt/${name}
+ cat > /run/binfmt/${name} << 'EOF'
+ #!/usr/bin/env sh
+ exec -- ${interpreter} "$@"
+ EOF
+ chmod +x /run/binfmt/${name}
+ '';
getEmulator = system: (lib.systems.elaborate { inherit system; }).emulator pkgs;