nixos-config/nix/verify/default.nix

34 lines
810 B
Nix
Raw Normal View History

{ self, ... }:
{
imports = [ ];
2024-09-13 09:36:17 +02:00
flake.nixosModules.verify = {
imports = [ ./module.nix ];
};
perSystem =
{
pkgs,
self',
lib,
...
}:
with lib;
{
2024-09-13 09:36:17 +02:00
apps.verify = {
type = "app";
program =
let
ports = machine: self.nixosConfigurations.${machine}.options.verify.closed.value.public.ports;
domain = machine: self.nixosConfigurations.${machine}.options.verify.closed.value.public.domain;
in
2024-09-13 09:36:17 +02:00
# todo : create an alert if one of the ports should not be accessible
pkgs.writers.writeBashBin "verify" ''
${pkgs.rustscan}/bin/rustscan --ports ${concatStringsSep "," (map toString (ports "orbi"))} --addresses ${domain "orbi"} --greppable
'';
};
};
}