diff options
author | Atemu <atemu.main@gmail.com> | 2024-04-05 01:46:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-05 01:46:09 +0200 |
commit | 86485bebac06ae466369b93fce9f92198895ccfc (patch) | |
tree | df0ea30d51d755bdb8e318ffa0b428741a0f0fb6 /nixos | |
parent | 6fae3c600101d1435977e01753727624fe3e77e0 (diff) | |
parent | f1019f971971bdf392ac5eb59a3a6854309a1007 (diff) |
Merge pull request #295452 from jopejoe1/appimage
nixos/appimage: init
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2405.section.md | 2 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/programs/appimage.nix | 33 |
3 files changed, 36 insertions, 0 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2405.section.md b/nixos/doc/manual/release-notes/rl-2405.section.md index 583747a00d0e0..2f75ebfa4050c 100644 --- a/nixos/doc/manual/release-notes/rl-2405.section.md +++ b/nixos/doc/manual/release-notes/rl-2405.section.md @@ -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). +- 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. diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 31633a53795af..e07295b4ba513 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -143,6 +143,7 @@ ./programs/adb.nix ./programs/alvr.nix ./programs/appgate-sdp.nix + ./programs/appimage.nix ./programs/atop.nix ./programs/ausweisapp.nix ./programs/autojump.nix diff --git a/nixos/modules/programs/appimage.nix b/nixos/modules/programs/appimage.nix new file mode 100644 index 0000000000000..0011c2ff578dc --- /dev/null +++ b/nixos/modules/programs/appimage.nix @@ -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 ]; +} |