dnstt_exporter/flake.nix

81 lines
2.2 KiB
Nix
Raw Normal View History

2026-05-05 13:28:32 +02:00
{
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
outputs =
{ self, nixpkgs }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = fn: nixpkgs.lib.genAttrs systems (system: fn nixpkgs.legacyPackages.${system});
in
{
2026-05-05 13:43:02 +02:00
packages = forAllSystems (pkgs: {
default = pkgs.buildGoModule {
pname = "dnstt_exporter";
version = "0.1.0";
src = ./.;
2026-05-05 13:57:12 +02:00
vendorHash = "sha256-+msAQqz07XVzGjpwi8PvlA7jP4Y+j/BgSZdnIc0LrpA=";
2026-05-05 13:43:02 +02:00
subPackages = [ "cmd/dnstt_exporter" ];
};
});
checks = forAllSystems (pkgs: {
tests = self.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (_: {
doCheck = true;
checkPhase = ''
runHook preCheck
go test ./...
runHook postCheck
'';
});
});
2026-05-05 13:28:32 +02:00
#checks = forAllSystems (
# pkgs:
# {
# tests = self.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (_: {
# pname = "nix-cache-login-tests";
# checkPhase = ''
# runHook preCheck
# go test ./...
# runHook postCheck
# '';
# doCheck = true;
# });
# module-checks = import ./module-checks.nix { inherit self pkgs; };
# devShell = self.devShells.${pkgs.stdenv.hostPlatform.system}.default;
# }
# // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
# nixos-module = pkgs.testers.runNixOSTest (import ./nixos-test.nix self);
# nixos-module-server = pkgs.testers.runNixOSTest (import ./nixos-test-server.nix self);
# }
#);
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
go
];
};
});
#nixosModules.default =
# {
# config,
# lib,
# pkgs,
# ...
# }:
# {
# imports = [ ./nixos-module.nix ];
# services.prometheus.exporters.dnstt.package =
# lib.mkDefault
# self.packages.${pkgs.stdenv.hostPlatform.system}.default;
# };
};
}