Skip to content

Commit ec0c9ca

Browse files
committed
feat(host): add new host sagittarius
1 parent d4b1791 commit ec0c9ca

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

hosts/x86_64-linux/sagittarius.nix

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
adminUser,
3+
config,
4+
pkgs,
5+
lib,
6+
...
7+
}: {
8+
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIOWdmZbf9/MQKKJEvb8LlOI/xeuAMt+GhNQjlKYzTCI";
9+
10+
bcachefs = {
11+
disks = ["/dev/nvme0n1"];
12+
devices = ["/dev/mapper/encrypted_root"];
13+
};
14+
15+
imports = [
16+
../../profiles/admin-user/home-manager.nix
17+
../../profiles/admin-user/user.nix
18+
../../profiles/disk/bcachefs-on-luks.nix
19+
../../profiles/hardware/tlsense.nix
20+
../../profiles/home-manager.nix
21+
../../profiles/server.nix
22+
../../profiles/state.nix
23+
../../profiles/tailscale.nix
24+
../../profiles/uuid_disk_crypt.nix
25+
../../profiles/zram.nix
26+
];
27+
28+
system.autoUpgrade = {
29+
enable = true;
30+
flake = "github:johnae/world";
31+
allowReboot = true;
32+
dates = "06:00";
33+
randomizedDelaySec = "5min";
34+
enableSentinel = false; ## not running kubernetes here
35+
};
36+
37+
boot.kernel = {
38+
## for tailscale exit node functionality
39+
sysctl."net.ipv4.ip_forward" = 1;
40+
41+
# Reboot this many seconds after panic
42+
sysctl."kernel.panic" = 20;
43+
44+
# Panic if the kernel detects an I/O channel
45+
# check (IOCHK). 0=no | 1=yes
46+
sysctl."kernel.panic_on_io_nmi" = 1;
47+
48+
# Panic if a hung task was found. 0=no, 1=yes
49+
sysctl."kernel.hung_task_panic" = 1;
50+
51+
# Setup timeout for hung task,
52+
# in seconds (suggested 300)
53+
sysctl."kernel.hung_task_timeout_secs" = 300;
54+
55+
# Panic on out of memory.
56+
# 0=no | 1=usually | 2=always
57+
sysctl."vm.panic_on_oom" = 1;
58+
59+
# Panic when the kernel detects an NMI
60+
# that usually indicates an uncorrectable
61+
# parity or ECC memory error. 0=no | 1=yes
62+
sysctl."kernel.panic_on_unrecovered_nmi" = 1;
63+
};
64+
65+
boot.initrd = {
66+
systemd.enable = true;
67+
systemd.tpm2.enable = true;
68+
};
69+
70+
services.tailscale.auth = {
71+
enable = true;
72+
args.advertise-tags = ["tag:server"];
73+
args.ssh = true;
74+
args.accept-routes = false;
75+
args.accept-dns = false;
76+
args.advertise-exit-node = true;
77+
args.auth-key = config.age.secrets.ts-google-9k.path;
78+
};
79+
80+
services.jae.router = {
81+
enable = true;
82+
useNextDns = true;
83+
nextDnsEnvFile = "/var/run/agenix/nextdns";
84+
restrictedMacs = [
85+
"5c:e0:c5:8a:24:6a"
86+
"b4:18:d1:ab:4e:5a"
87+
];
88+
upstreamDnsServers = [
89+
"2a07:a8c1::"
90+
"45.90.30.0"
91+
"2a07:a8c0::"
92+
"45.90.28.0"
93+
];
94+
externalInterface = "enp1s0f0";
95+
internalInterface = "enp2s0";
96+
internalInterfaceIP = "192.168.20.3"; ## fix
97+
dnsMasqSettings.no-resolv = true;
98+
dnsMasqSettings.bogus-priv = true;
99+
dnsMasqSettings.strict-order = true;
100+
};
101+
102+
services.dnsmasq.enable = lib.mkForce false; ## remove
103+
104+
age.secrets = {
105+
ts-google-9k = {
106+
file = ../../secrets/ts-google-9k.age;
107+
owner = "1337";
108+
};
109+
nextdns = {
110+
file = ../../secrets/nextdns.age;
111+
};
112+
};
113+
114+
users.users.${adminUser.name}.shell = lib.mkForce pkgs.bashInteractive;
115+
116+
home-manager = {
117+
users.${adminUser.name} = {
118+
imports = [../../users/profiles/minimal.nix];
119+
};
120+
};
121+
}

secrets/nextdns.age

110 Bytes
Binary file not shown.

secrets/ts-google-9k.age

110 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)