commit 3962b77415a6c8fc587dd5258f1bb6ab676a0580
parent 1d6452f3c6fe65444a6115f49a5cf25724dee42d
Author: Katja (ctucx) <git@ctu.cx>
Date: Mon, 17 Mar 2025 10:20:16 +0100
parent 1d6452f3c6fe65444a6115f49a5cf25724dee42d
Author: Katja (ctucx) <git@ctu.cx>
Date: Mon, 17 Mar 2025 10:20:16 +0100
remove `writeZone` function and `flake-utils` flake-input, fix `toString` fuction
3 files changed, 16 insertions(+), 62 deletions(-)
diff --git a/flake.lock b/flake.lock @@ -1,20 +1,5 @@ { "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1614513358, - "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1616989418, @@ -32,7 +17,6 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } }
diff --git a/flake.nix b/flake.nix @@ -3,43 +3,24 @@ # SPDX-License-Identifier: MPL-2.0 or MIT { + description = "A Nix DSL for defining DNS zones"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - flake-utils.url = "github:numtide/flake-utils"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + + outputs = inputs: let + inherit (inputs.nixpkgs) lib; + dns = import ./dns { inherit lib; }; + + in { + + lib = { + inherit (dns) evalZone; + inherit (dns) combinators; + inherit (dns) types; + toString = name: zone: dns.types.zoneToString name (dns.evalZone name zone); + } // dns.combinators; + }; - outputs = { self, nixpkgs, flake-utils }: - let - inherit (nixpkgs) lib; - dns = import ./dns { inherit lib; }; - in { - - lib = { - inherit (dns) evalZone; - inherit (dns) combinators; - inherit (dns) types; - toString = name: zone: builtins.toString (dns.evalZone name zone); - } // dns.combinators; - - } // flake-utils.lib.eachDefaultSystem (system: - let pkgs = nixpkgs.legacyPackages.${system}; - in { - util = { - writeZone = import ./util/writeZone.nix { - inherit (self.lib) evalZone; - inherit (self.lib.types) zoneToString; - inherit (pkgs) writeTextFile; - }; - }; - - checks = { - eval-lib = pkgs.writeText "eval-lib" (builtins.deepSeq self.lib "OK"); - reuse = pkgs.runCommand "reuse-lint" { - nativeBuildInputs = [ pkgs.reuse ]; - } ''reuse --root ${./.} lint > "$out"''; - }; - } - ); }
diff --git a/util/writeZone.nix b/util/writeZone.nix @@ -1,11 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Kirill Elagin <https://kir.elagin.me/> -# -# SPDX-License-Identifier: MPL-2.0 or MIT - -{ evalZone, zoneToString, writeTextFile }: - -name: zone: - writeTextFile { - name = "${name}.zone"; - text = zoneToString name (evalZone name zone); - }