nixos-config/nix/scan/default.nix

32 lines
723 B
Nix
Raw Normal View History

{ self, ... }:
{
imports = [ ];
flake.nixosModules.scan = {
imports = [ ./module.nix ];
};
perSystem =
{
pkgs,
self',
lib,
...
}:
with lib;
{
apps.scan = {
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
pkgs.writers.writeBashBin "scan" ''
${pkgs.rustscan}/bin/rustscan --ports ${concatStringsSep "," (map toString (ports "orbi"))} --addresses ${domain "orbi"} --greppable
'';
};
};
}