Commit f1019f97 authored by jopejoe1's avatar jopejoe1
Browse files

nixos/appimage: init

parent ddbd484a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -103,6 +103,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).

- 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)

- [RustDesk](https://rustdesk.com), a full-featured open source remote control alternative for self-hosting and security with minimal configuration. Alternative to TeamViewer.
+1 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@
  ./programs/adb.nix
  ./programs/alvr.nix
  ./programs/appgate-sdp.nix
  ./programs/appimage.nix
  ./programs/atop.nix
  ./programs/ausweisapp.nix
  ./programs/autojump.nix
+33 −0
Original line number Diff line number Diff line
{ 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 ];
}