Giter Site home page Giter Site logo

Comments (4)

ncfavier avatar ncfavier commented on September 21, 2024

writeZone relies on pkgs.writeTextFile, which is only available when the full nixpkgs is instantiated (import "${nixpkgs}" { system = "some-system"; }).

What do you mean? How are you importing dns/default.nix?

from dns.nix.

AluisioASG avatar AluisioASG commented on September 21, 2024

Here's a minimal example:

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.dns = { url = "github:kirelagin/nix-dns"; inputs.nixpkgs.follows = "nixpkgs"; };
  outputs = { self, nixpkgs, dns }: {
    defaultPackage.x86_64-linux = dns.lib.writeZone "example.invalid" {
      SOA = { nameServer = "ns.example.invalid"; adminEmail = "[email protected]"; serial = 1; };
    };
  };
}

nix build results in:

error: --- EvalError ----------------------------------------------------------------- nix
at: (32:5) in file: /nix/store/lnphin86szjd22maxjcj51kk13gf34nl-source/dns/default.nix

    31|   writeZone = name: zone:
    32|     pkgs.writeTextFile {
      |     ^
    33|       name = "${name}.zone";
attribute 'writeTextFile' missing

writeZone seems to be the only part of nix-dns that accesses something out of pkgs.lib (which in flake mode is the lib output of the Nixpkgs flake) and that's why only it breaks.

from dns.nix.

ncfavier avatar ncfavier commented on September 21, 2024

Hm. And there's no way to actually import nixpkgs in pure mode without specifying what system we're running on, which the lib flake attribute doesn't support.

Maybe we could use builtins.toFile instead of pkgs.writeTextFile, as the zone shouldn't depend on any derivations?

from dns.nix.

kirelagin avatar kirelagin commented on September 21, 2024

Hmmmm, I think the correct solution here would be to move writeZone out of the lib output into some other output and do the full eachDefaultSystem dance.

from dns.nix.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.