all repos — dns @ main

DNS records for my domains, managed via dnscontrol

lon.nix (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Generated by lon. Do not modify!
let

  lock = builtins.fromJSON (builtins.readFile ./lon.lock);

  # Override with a path defined in an environment variable. If no variable is
  # set, the original path is used.
  overrideFromEnv =
    name: path:
    let
      replacement = builtins.getEnv "LON_OVERRIDE_${name}";
    in
    if replacement == "" then
      path
    else
    # this turns the string into an actual Nix path (for both absolute and
    # relative paths)
    if builtins.substring 0 1 replacement == "/" then
      /. + replacement
    else
      /. + builtins.getEnv "PWD" + "/${replacement}";

  fetchSource =
    args@{ fetchType, ... }:
    if fetchType == "git" then
      builtins.fetchGit (
        {
          url = args.url;
          ref = args.branch;
          rev = args.revision;
          narHash = args.hash;
          submodules = args.submodules;
        }
        // (
          if args ? lastModified then
            {
              inherit (args) lastModified;
              shallow = true;
            }
          else
            { }
        )
      )
    else if fetchType == "tarball" then
      builtins.fetchTarball {
        url = args.url;
        sha256 = args.hash;
      }
    else
      builtins.throw "Unsupported source type ${fetchType}";

in
builtins.mapAttrs (name: args: overrideFromEnv name (fetchSource args)) lock.sources