Something went wrong. Try again.
Open a URI in the user's chosen application from Zig: the desktop portal on Linux, ShellExecuteExW on Windows, Launch Services on macOS.
Something went wrong. Try again.
zig-openuri flake.nix
1.2 kB · 51 lines
Nix
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us># SPDX-License-Identifier: MIT
{ description = "Open URIs in the user's chosen application from Zig";
inputs = { nixpkgs = { url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; }; };
outputs = { nixpkgs, ... }: let inherit (nixpkgs) lib; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs lib.systems.flakeExposed; in { devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { name = "zig-openuri"; nativeBuildInputs = [ pkgs.git-pages-cli pkgs.reuse pkgs.zig_0_17 ] ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [ # The integration test starts a private bus with a fake portal # on it, so that the Linux path is tested without a desktop. pkgs.dbus pkgs.kcov ]; }; } ); };}