Files
skyg-linux-tracker/flake.nix
T
ari ca000d973f F: F2 promote the peers VM test and the module eval test into checks
The test nodes declare peers through the first-class module options, so
LoadCredential and RefreshOnReload come from the module. Every node binds
:: because the test network resolves node names to IPv6 first. poll()
raises with the last observed status JSON.
2026-10-20 15:04:09 -04:00

54 lines
1.8 KiB
Nix

{
description = "skyg-linux-tracker: read-only systemd, journal and Docker monitor";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
systems = [ "x86_64-linux" "aarch64-linux" ];
forAll = f: nixpkgs.lib.genAttrs systems (s: f nixpkgs.legacyPackages.${s});
in
{
packages = forAll (pkgs: rec {
skyg-linux-tracker = pkgs.callPackage ./nix/package.nix { };
default = skyg-linux-tracker;
});
nixosModules.default = { pkgs, lib, ... }: {
imports = [ ./nix/module.nix ];
services.skyg-linux-tracker.package =
lib.mkDefault self.packages.${pkgs.stdenv.hostPlatform.system}.default;
};
checks.${system} =
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
package = self.packages.${system}.default;
vm = import ./nix/tests/vm.nix {
inherit pkgs;
module = self.nixosModules.default;
};
vm-peers = import ./nix/tests/peers.nix {
inherit pkgs;
module = self.nixosModules.default;
};
# Evaluation-only: every case renders the module's config and unit,
# so forcing the list either lists the passed checks or throws. The
# output file is only there to give `nix flake check` a derivation.
module-peers = pkgs.runCommand "skyg-linux-tracker-module-peers-eval" { } ''
printf '%s\n' ${
nixpkgs.lib.escapeShellArg (
builtins.concatStringsSep "\n" (import ./nix/tests/module-peers.nix {
inherit pkgs;
module = self.nixosModules.default;
})
)
} > $out
'';
};
};
}