Files
PVV-DNS/flake.nix
T

47 lines
1.3 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 =
{ self, 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 { };
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
'';
});
checks = forAllSystems (system: _: rec {
zoneFiles = self.packages.${system}.zoneFiles.overrideAttrs { doCheck = true; };
nsdConfig = self.packages.${system}.nsdConfig.override { doCheck = true; };
});
};
}