mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-04 09:36:33 +01:00
update appimage module
This commit is contained in:
parent
b982371fb1
commit
b18f14e641
1 changed files with 20 additions and 6 deletions
|
@ -1,19 +1,33 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
let cfg = config.programs.appimage;
|
let
|
||||||
in {
|
cfg = config.programs.appimage;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
options.programs.appimage = {
|
options.programs.appimage = {
|
||||||
enable = lib.mkEnableOption "Enable AppImage Support";
|
enable = lib.mkEnableOption "appimage-run wrapper script for executing appimages on NixOS";
|
||||||
|
binfmt = lib.mkEnableOption "binfmt registration to run appimages via appimage-run seamlessly";
|
||||||
|
package = lib.mkPackageOption pkgs "appimage-run" {
|
||||||
|
example = ''
|
||||||
|
pkgs.appimage-run.override {
|
||||||
|
extraPkgs = pkgs: [ pkgs.ffmpeg pkgs.imagemagick ];
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
boot.binfmt.registrations.appimage = {
|
boot.binfmt.registrations.appimage = lib.mkIf cfg.binfmt {
|
||||||
wrapInterpreterInShell = false;
|
wrapInterpreterInShell = false;
|
||||||
interpreter = "${pkgs.appimage-run}/bin/appimage-run";
|
interpreter = lib.getExe cfg.package;
|
||||||
recognitionType = "magic";
|
recognitionType = "magic";
|
||||||
offset = 0;
|
offset = 0;
|
||||||
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
|
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
|
||||||
magicOrExtension = ''\x7fELF....AI\x02'';
|
magicOrExtension = ''\x7fELF....AI\x02'';
|
||||||
};
|
};
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
meta.maintainers = with lib.maintainers; [ jopejoe1 atemu ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue