mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #328662 from Aleksanaa/nixos/appimage
nixos/appimage: support both type-1 and type-2 appimages in binfmt
This commit is contained in:
commit
f6d4f4f055
1 changed files with 30 additions and 10 deletions
|
@ -1,4 +1,9 @@
|
||||||
{ lib, config, pkgs, ... }:
|
{
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.appimage;
|
cfg = config.programs.appimage;
|
||||||
|
@ -18,16 +23,31 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
boot.binfmt.registrations.appimage = lib.mkIf cfg.binfmt {
|
boot.binfmt.registrations.appimage = lib.mkIf cfg.binfmt (
|
||||||
wrapInterpreterInShell = false;
|
let
|
||||||
interpreter = lib.getExe cfg.package;
|
appimage_common = {
|
||||||
recognitionType = "magic";
|
wrapInterpreterInShell = false;
|
||||||
offset = 0;
|
interpreter = lib.getExe cfg.package;
|
||||||
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
|
recognitionType = "magic";
|
||||||
magicOrExtension = ''\x7fELF....AI\x02'';
|
offset = 0;
|
||||||
};
|
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
appimage_type_1 = appimage_common // {
|
||||||
|
magicOrExtension = ''\x7fELF....AI\x01'';
|
||||||
|
};
|
||||||
|
appimage_type_2 = appimage_common // {
|
||||||
|
magicOrExtension = ''\x7fELF....AI\x02'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
|
|
||||||
meta.maintainers = with lib.maintainers; [ jopejoe1 atemu ];
|
meta.maintainers = with lib.maintainers; [
|
||||||
|
jopejoe1
|
||||||
|
atemu
|
||||||
|
aleksana
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue