From 9a40fa7462caf5c478486f56170f5cd8234396ef Mon Sep 17 00:00:00 2001 From: Ketan Vijayvargiya Date: Thu, 13 Jun 2024 21:40:42 -0700 Subject: [PATCH] Add a Nix flake --- .gitignore | 1 + README.md | 3 +++ flake.lock | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 13 ++++++++++++ 4 files changed, 75 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b2be92b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result diff --git a/README.md b/README.md index 313cab2..8ad4079 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ This repository contains the code to manage all my DNS records. docker run --rm -it \ -v "$HOME/app-data/dns-config:/dns" \ ghcr.io/stackexchange/dnscontrol preview +# OR: +nix run . -- version +nix run . -- preview # Pull in changes from an existing DNS provider docker run --rm -it \ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cf31a1b --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "id": "flake-utils", + "type": "indirect" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1718149104, + "narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..123de48 --- /dev/null +++ b/flake.nix @@ -0,0 +1,13 @@ +{ + description = "Nix configuration for dns-config"; + + inputs = {}; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in { + packages.default = nixpkgs.legacyPackages.${system}.dnscontrol; + }); +}