mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
dns
This commit is contained in:
parent
7fdbf50900
commit
ddd851ae6e
4 changed files with 106 additions and 14 deletions
|
|
@ -5,8 +5,7 @@
|
||||||
# - A path to a Nixpkgs checkout
|
# - A path to a Nixpkgs checkout
|
||||||
# - The Nixpkgs lambda (e.g., import <nixpkgs>)
|
# - The Nixpkgs lambda (e.g., import <nixpkgs>)
|
||||||
# - An initialized Nixpkgs attribute set
|
# - An initialized Nixpkgs attribute set
|
||||||
# TODO: Pin
|
nixpkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/a1cc729dcbc31d9b0d11d86dc7436163548a9665.tar.gz"); # nixos-24.05 2024-07-26
|
||||||
nixpkgs = import <nixpkgs>;
|
|
||||||
|
|
||||||
# If your Colmena host has nix configured to allow for remote builds
|
# If your Colmena host has nix configured to allow for remote builds
|
||||||
# (for nix-daemon, your user being included in trusted-users)
|
# (for nix-daemon, your user being included in trusted-users)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,17 @@
|
||||||
{ from = 53; to = 53; }
|
{ from = 53; to = 53; }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
nix-dns = import (pkgs.fetchFromGitHub {
|
||||||
|
owner = "nix-community";
|
||||||
|
repo = "dns.nix";
|
||||||
|
rev = "v1.1.2";
|
||||||
|
hash = "sha256-EHiDP2jEa7Ai5ZwIf5uld9RVFcV77+2SUxjQXwJsJa0=";
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
services.knot = {
|
services.knot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settingsFile = pkgs.writeTextFile {
|
settingsFile = pkgs.writeTextFile {
|
||||||
|
|
@ -19,6 +30,9 @@
|
||||||
- domain: noratrieb.dev
|
- domain: noratrieb.dev
|
||||||
storage: /var/lib/knot/zones/
|
storage: /var/lib/knot/zones/
|
||||||
file: ${import ./noratrieb.dev.nix { inherit pkgs; }}
|
file: ${import ./noratrieb.dev.nix { inherit pkgs; }}
|
||||||
|
- domain: nilstrieb.dev
|
||||||
|
storage: /var/lib/knot/zones/
|
||||||
|
file: ${import ./nilstrieb.dev.nix { inherit pkgs; }}
|
||||||
log:
|
log:
|
||||||
- target: syslog
|
- target: syslog
|
||||||
any: info
|
any: info
|
||||||
|
|
|
||||||
88
newinfra/nix/modules/dns/nilstrieb.dev.nix
Normal file
88
newinfra/nix/modules/dns/nilstrieb.dev.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
# https://github.com/nix-community/dns.nix
|
||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
data = with pkgs.nix-dns.lib.combinators;
|
||||||
|
let
|
||||||
|
dns1 = host "154.38.163.74" null;
|
||||||
|
dns2 = host "128.140.3.7" "2a01:4f8:c2c:d616::";
|
||||||
|
|
||||||
|
vps1 = host "184.174.32.252" null;
|
||||||
|
vps2 = host "161.97.165.1" null;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
SOA = {
|
||||||
|
nameServer = "ns1.noratrieb.dev";
|
||||||
|
adminEmail = "void@noratrieb.dev";
|
||||||
|
serial = 2024072601;
|
||||||
|
};
|
||||||
|
|
||||||
|
TXT = [
|
||||||
|
"protonmail-verification=86964dcc4994261eab23dbc53dad613b10bab6de"
|
||||||
|
"v=spf1 include:_spf.protonmail.ch ~all"
|
||||||
|
];
|
||||||
|
|
||||||
|
NS = [
|
||||||
|
"ns1.noratrieb.dev"
|
||||||
|
"ns2.noratrieb.dev"
|
||||||
|
];
|
||||||
|
|
||||||
|
A = [
|
||||||
|
# GH Pages
|
||||||
|
(a "185.199.108.153")
|
||||||
|
(a "185.199.109.153")
|
||||||
|
(a "185.199.110.153")
|
||||||
|
(a "185.199.111.153")
|
||||||
|
];
|
||||||
|
AAAA = [
|
||||||
|
# GH Pages
|
||||||
|
(aaaa "2606:50c0:8002:0:0:0:0:153")
|
||||||
|
(aaaa "2606:50c0:8003:0:0:0:0:153")
|
||||||
|
(aaaa "2606:50c0:8000:0:0:0:0:153")
|
||||||
|
(aaaa "2606:50c0:8001:0:0:0:0:153")
|
||||||
|
];
|
||||||
|
|
||||||
|
MX = with mx; [
|
||||||
|
(mx 10 "mail.protonmail.ch")
|
||||||
|
(mx 20 "mailsec.protonmail.ch")
|
||||||
|
];
|
||||||
|
|
||||||
|
subdomains = {
|
||||||
|
www = vps1;
|
||||||
|
blog.CNAME = [ (cname "nilstrieb.github.io") ];
|
||||||
|
|
||||||
|
# apps
|
||||||
|
bisect-rustc = vps1;
|
||||||
|
cors-school = vps1 // {
|
||||||
|
subdomains.api = vps1;
|
||||||
|
};
|
||||||
|
docker = vps1;
|
||||||
|
hugo-chat = vps1 // {
|
||||||
|
subdomains.api = vps1;
|
||||||
|
};
|
||||||
|
olat = vps1;
|
||||||
|
uptime = vps1;
|
||||||
|
|
||||||
|
localhost.A = [ (a "127.0.0.1") ];
|
||||||
|
|
||||||
|
# infra (legacy)
|
||||||
|
inherit vps1;
|
||||||
|
inherit vps2;
|
||||||
|
inherit dns1;
|
||||||
|
inherit dns2;
|
||||||
|
|
||||||
|
pronouns.TXT = [
|
||||||
|
"TODO"
|
||||||
|
];
|
||||||
|
|
||||||
|
ns1 = dns1;
|
||||||
|
ns2 = dns2;
|
||||||
|
|
||||||
|
newtest.TXT = [ "uwu it works" ];
|
||||||
|
bsky.subdomains.atproto.TXT = [ "did=did:plc:pqyzoyxk7gfcbxk65mjyncyl" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.writeTextFile {
|
||||||
|
name = "noratrieb.dev.zone";
|
||||||
|
text = pkgs.nix-dns.lib.toString "noratrieb.dev" data;
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,7 @@
|
||||||
# https://github.com/nix-community/dns.nix
|
# https://github.com/nix-community/dns.nix
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
let
|
||||||
# TODO: do this in a central place
|
data = with pkgs.nix-dns.lib.combinators;
|
||||||
dns = import (pkgs.fetchFromGitHub {
|
|
||||||
owner = "nix-community";
|
|
||||||
repo = "dns.nix";
|
|
||||||
rev = "v1.1.2";
|
|
||||||
hash = "sha256-EHiDP2jEa7Ai5ZwIf5uld9RVFcV77+2SUxjQXwJsJa0=";
|
|
||||||
});
|
|
||||||
|
|
||||||
data = with dns.lib.combinators;
|
|
||||||
let
|
let
|
||||||
dns1 = host "154.38.163.74" null;
|
dns1 = host "154.38.163.74" null;
|
||||||
dns2 = host "128.140.3.7" "2a01:4f8:c2c:d616::";
|
dns2 = host "128.140.3.7" "2a01:4f8:c2c:d616::";
|
||||||
|
|
@ -35,8 +27,7 @@ let
|
||||||
"she/her"
|
"she/her"
|
||||||
];
|
];
|
||||||
|
|
||||||
# ns1 = dns1;
|
newtest.TXT = [ "uwu it works" ];
|
||||||
# ns2 = dns2;
|
|
||||||
|
|
||||||
infra.subdomains = {
|
infra.subdomains = {
|
||||||
inherit dns1;
|
inherit dns1;
|
||||||
|
|
@ -47,5 +38,5 @@ let
|
||||||
in
|
in
|
||||||
pkgs.writeTextFile {
|
pkgs.writeTextFile {
|
||||||
name = "noratrieb.dev.zone";
|
name = "noratrieb.dev.zone";
|
||||||
text = dns.lib.toString "noratrieb.dev" data;
|
text = pkgs.nix-dns.lib.toString "noratrieb.dev" data;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue