This repository has been archived on 2026-02-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-01-10 13:10:29 +01:00

93 lines
2.5 KiB
Nix

{
description = "dns-mesher - Distributed DNS zone propagation for clan networks";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
clan-core.url = "git+https://git.clan.lol/clan/clan-core";
flake-parts.follows = "clan-core/flake-parts";
};
outputs =
inputs@{
self,
clan-core,
flake-parts,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
];
imports = [
# Import clan's flake-parts modules
clan-core.flakeModules.clan
clan-core.flakeModules.testModule
];
# Register our dns-mesher module with clan (passes self for package building)
clan.modules = {
dns-mesher = import ./clanServices/dns-mesher/default.nix { inherit self; };
};
perSystem =
{
pkgs,
...
}:
let
data-smasher = pkgs.buildGoModule {
pname = "data-smasher";
version = "unstable";
src = ./.;
vendorHash = null;
};
dns-mesher-push = pkgs.stdenv.mkDerivation {
pname = "dns-mesher-push";
version = "unstable";
src = ./dns-mesher-push.py;
dontUnpack = true;
buildInputs = [
(pkgs.python3.withPackages (ps: [
ps.requests
ps.cryptography
]))
];
installPhase = ''
install -Dm755 $src $out/bin/dns-mesher-push
'';
meta = {
description = "Push signed zone data to dns-mesher/data-smasher nodes";
mainProgram = "dns-mesher-push";
};
};
in
{
# Provide the data-smasher binary package
packages = {
default = data-smasher;
inherit data-smasher dns-mesher-push;
};
# Register the test
clan.nixosTests.dns-mesher = {
imports = [ ./clanServices/dns-mesher/tests/vm/default.nix ];
# Pass self to the module for package building
clan.modules."dns-mesher" = import ./clanServices/dns-mesher/default.nix { inherit self; };
};
};
flake = {
# Expose the clan service module with embedded source
# Usage in clan config: modules."@pinpox/dns-mesher" = dns-mesher.clanModules.dns-mesher;
clanModules.dns-mesher = import ./clanServices/dns-mesher/default.nix { inherit self; };
};
};
}