# SPDX-FileCopyrightText: © 2024 Jeffrey C. Ollie # SPDX-License-Identifier: MIT { description = "Zig library for writing structured log messages to the systemd journal"; inputs = { nixpkgs = { url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; }; }; outputs = { self, nixpkgs, ... }: let inherit (nixpkgs) lib; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs lib.systems.flakeExposed; in { packages = forAllSystems ( system: let pkgs = makePackages system; in rec { journalz = pkgs.callPackage ./package.nix { }; default = journalz; } ); # Linux only: these are NixOS virtual machine tests, and without the # filter `nix flake check` tries to evaluate them for Darwin and fails # before it has run anything. checks = lib.genAttrs (lib.filter (system: lib.hasSuffix "-linux" system) lib.systems.flakeExposed) ( system: let pkgs = makePackages system; journalz = pkgs.callPackage ./package.nix { }; test = file: pkgs.testers.runNixOSTest (import file { inherit journalz; }); in { inherit journalz; journald = test ./tests/nixos/journald.nix; } ); devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { nativeBuildInputs = [ pkgs.zig_0_17 pkgs.git-pages-cli pkgs.reuse ]; }; } ); }; }