Merge pull request #295452 from jopejoe1/appimage

nixos/appimage: init
This commit is contained in:
Atemu 2024-04-05 01:46:09 +02:00 committed by GitHub
commit 86485bebac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 0 deletions

View file

@ -141,6 +141,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- [TuxClocker](https://github.com/Lurkki14/tuxclocker), a hardware control and monitoring program. Available as [programs.tuxclocker](#opt-programs.tuxclocker.enable). - [TuxClocker](https://github.com/Lurkki14/tuxclocker), a hardware control and monitoring program. Available as [programs.tuxclocker](#opt-programs.tuxclocker.enable).
- binfmt option for AppImage-run to support running [AppImage](https://appimage.org/)'s seamlessly on NixOS.. Available as [programs.appimage.binfmt](#opt-programs.appimage.binfmt).
- [ALVR](https://github.com/alvr-org/alvr), a VR desktop streamer. Available as [programs.alvr](#opt-programs.alvr.enable) - [ALVR](https://github.com/alvr-org/alvr), a VR desktop streamer. Available as [programs.alvr](#opt-programs.alvr.enable)
- [RustDesk](https://rustdesk.com), a full-featured open source remote control alternative for self-hosting and security with minimal configuration. Alternative to TeamViewer. - [RustDesk](https://rustdesk.com), a full-featured open source remote control alternative for self-hosting and security with minimal configuration. Alternative to TeamViewer.

View file

@ -143,6 +143,7 @@
./programs/adb.nix ./programs/adb.nix
./programs/alvr.nix ./programs/alvr.nix
./programs/appgate-sdp.nix ./programs/appgate-sdp.nix
./programs/appimage.nix
./programs/atop.nix ./programs/atop.nix
./programs/ausweisapp.nix ./programs/ausweisapp.nix
./programs/autojump.nix ./programs/autojump.nix

View file

@ -0,0 +1,33 @@
{ lib, config, pkgs, ... }:
let
cfg = config.programs.appimage;
in
{
options.programs.appimage = {
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 {
boot.binfmt.registrations.appimage = lib.mkIf cfg.binfmt {
wrapInterpreterInShell = false;
interpreter = lib.getExe cfg.package;
recognitionType = "magic";
offset = 0;
mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
magicOrExtension = ''\x7fELF....AI\x02'';
};
environment.systemPackages = [ cfg.package ];
};
meta.maintainers = with lib.maintainers; [ jopejoe1 atemu ];
}