nixos-config/nix/verify/default.nix
Ingolf Wagner f49730a0a9
🚚 renaming
2024-09-13 14:36:17 +07:00

33 lines
810 B
Nix

{ self, ... }:
{
imports = [ ];
flake.nixosModules.verify = {
imports = [ ./module.nix ];
};
perSystem =
{
pkgs,
self',
lib,
...
}:
with lib;
{
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
# 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
'';
};
};
}