42 lines
1.1 KiB
Nix
42 lines
1.1 KiB
Nix
{
|
|
description = "PVV-DNS";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
|
|
|
# Broken, wait for https://github.com/nix-community/dns.nix/pull/52
|
|
#dns.url = "github:nix-community/dns.nix";
|
|
dns.url = "github:felixalbrigtsen/dns.nix";
|
|
dns.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs =
|
|
{ nixpkgs, dns, ... }@inputs:
|
|
let
|
|
inherit (nixpkgs) lib;
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
|
|
in
|
|
{
|
|
packages = forAllSystems (system: pkgs: rec {
|
|
zoneFiles = pkgs.callPackage ./zoneConfig.nix {
|
|
inherit dns;
|
|
};
|
|
|
|
nsdConfig = pkgs.callPackage ./nsd.conf.nix { inherit pkgs; };
|
|
|
|
default = pkgs.runCommand "pvv-dns" { } ''
|
|
mkdir -p $out/zones
|
|
mkdir -p $out/etc/nsd
|
|
|
|
cp -r ${zoneFiles}/* $out/zones/
|
|
cp -r ${nsdConfig} $out/etc/nsd/nsd.conf
|
|
'';
|
|
});
|
|
};
|
|
}
|