❄️ Dotfiles for our NixOS system configuration.

feat: caddy + services

Chloe b0b57a21 b51c435e

Changed files
+232
hosts
dullscythe
secrets
services
+1
hosts/dullscythe/default.nix
···
{
imports = [
./hardware.nix
];
settings = {
···
{
imports = [
./hardware.nix
+
../../services
];
settings = {
+13
secrets/caddy.env.age
···
···
+
-----BEGIN AGE ENCRYPTED FILE-----
+
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IDFDVDk3dyBtdXht
+
R0xWSE9oS01obUxRL3l6QVhWamNyZDRoZ1ZESEc1V3g4WkZZeDJnCmc0TlhuRlhR
+
MW83VFNWa3NCZjhyRHpXYlRiS2d0ZGRTMGpyNFlUN3hoRzQKLT4gc3NoLWVkMjU1
+
MTkgZVAzVHRRIEsvbWk2dFg1MlB0VGRTL2NET2FIWW1MREc1RUVGSEQvUFFoZTdh
+
Sm9RU1UKY2pTeW9BMnVlcHh0OS92a3ZLSWwrTUtEdm82ajFRdC91YzZiSzdKUnY0
+
bwotPiBSe3dlTS1ncmVhc2UgT1dyfSByZ2Y8bSA0dFVOLC0KbmEyQk1KaVlGcjdK
+
bGp1d3JML2Z5WFVsWnlxdzJ1Y3owTHVQNEJwMnMrc0Jvd0FKSm9pNnZnTVVicVdU
+
UmYyVQp0N2c4Tk1LR2x3cEo0WHNHS2ZCMW9DbEpBL3FOQ3FOakJZcDZ0aGcKLS0t
+
IHJxOVhmRzhacHF2ZWlRT1FaOHU3Wk4zOUV1NVE5VzgrMEtXbEUzOUpoWFUK0AIu
+
jL2DKEdBY9fnhsxzAJF3YdYvZp3ZodaO7zeeK23iCaqCB2MTFrMgJ5z420yA+JDH
+
E8wwcXDVNFfoEyLKcy4v/s4oNpf+aILb5TQMxBESMJ/LusA=
+
-----END AGE ENCRYPTED FILE-----
+12
secrets/secrets.nix
···
···
+
let
+
key1 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJug+9rnFngnFQpY0lAO0NuVBhDCcJc5imPHazgOSTTx";
+
key2 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICM6XP+CNc2CStEDe/W4LfkcRcG98obQiM2aqnydCRbX";
+
+
keys = [
+
key1
+
key2
+
];
+
in
+
{
+
"caddy.env.age".publicKeys = keys;
+
}
+51
services/caddy.nix
···
···
+
{ config, pkgs, ... }:
+
+
{
+
age.secrets.caddy_env = {
+
file = ../secrets/caddy.env.age;
+
mode = "600";
+
};
+
+
services.caddy = {
+
enable = true;
+
package = pkgs.caddy.withPlugins {
+
plugins = [ "github.com/caddy-dns/cloudflare@v0.2.1" ];
+
hash = "sha256-XwZ0Hkeh2FpQL/fInaSq+/3rCLmQRVvwBM0Y1G1FZNU=";
+
};
+
environmentFile = config.age.secrets.caddy_env.path;
+
globalConfig = ''
+
email chloe@sapphic.moe
+
'';
+
extraConfig = ''
+
(tls_cloudflare) {
+
tls {
+
dns cloudflare {env.CF_API_TOKEN}
+
resolvers 8.8.8.8 1.1.1.1
+
}
+
}
+
(common) {
+
encode zstd gzip
+
}
+
'';
+
virtualHosts."home.sappho.systems" = {
+
listenAddresses = [ "::" ];
+
extraConfig = ''
+
import common
+
import tls_cloudflare
+
reverse_proxy http://localhost:4040
+
'';
+
};
+
};
+
+
systemd.services.caddy = {
+
serviceConfig = {
+
EnvironmentFile = config.age.secrets.caddy_env.path;
+
};
+
};
+
+
networking.firewall.allowedTCPPorts = [
+
80
+
443
+
];
+
networking.firewall.allowedUDPPorts = [ 443 ];
+
}
+6
services/default.nix
···
···
+
{
+
imports = [
+
./caddy.nix
+
./glance/default.nix
+
];
+
}
+20
services/glance/default.nix
···
···
+
{ pkgs, ... }:
+
+
{
+
systemd.services.glance = {
+
description = "Glance dashboard";
+
after = [ "network.target" ];
+
wantedBy = [ "multi-user.target" ];
+
reloadTriggers = [ "/etc/glance.yml" ];
+
serviceConfig = {
+
ExecStart = ''
+
${pkgs.glance}/bin/glance --config /etc/glance.yml
+
'';
+
Restart = "always";
+
RestartSec = 2;
+
};
+
};
+
+
environment.etc."glance.yml".text = builtins.readFile ./glance.yml;
+
networking.firewall.allowedTCPPorts = [ 4040 ];
+
}
+129
services/glance/glance.yml
···
···
+
# Example Glance config
+
# Replace with your actual configuration
+
+
server:
+
host: 0.0.0.0
+
port: 4040
+
+
+
theme:
+
background-color: 240 21 15
+
contrast-multiplier: 1.2
+
primary-color: 316 72 86
+
positive-color: 115 54 76
+
negative-color: 343 81 75
+
+
pages:
+
- name: Home
+
columns:
+
- size: small
+
widgets:
+
- type: clock
+
hour-format: 24h
+
timezones:
+
- timezone: Australia/Sydney
+
label: Sydney
+
- timezone: Europe/Istanbul
+
label: Istanbul
+
- timezone: Europe/Amsterdam
+
label: Amsterdam
+
- timezone: Europe/London
+
label: London
+
- timezone: America/Menominee
+
label: Wisconsin
+
- timezone: America/Vancouver
+
label: Victoria Island
+
+
- type: rss
+
limit: 10
+
collapse-after: 3
+
cache: 3h
+
feeds:
+
- url: https://ovyerus.com/posts/rss.xml
+
title: Ovyerus (blog)
+
- url: https://ovyerus.com/weeknotes/rss.xml
+
title: Ovyerus (weeknotes)
+
- url: https://adryd.com/feed.xml
+
title: adryd
+
- url: https://notnite.com/blog/rss.xml
+
title: notnite's blog
+
- url: https://lyra.horse/blog/posts/index.xml
+
title: Lyra (Rebane2001)'s posts
+
- url: https://maia.crimew.gay/feed.xml
+
title: maia blog
+
- url: https://kibty.town/blog.rss
+
title: xyzeva's blog
+
- url: https://char.lt/blog.rss
+
title: charlotte som's blog
+
- url: https://mae.wtf/rss.xml
+
title: vimae's blog
+
- url: https://cookieplmonster.github.io/feed.xml
+
title: Silent's blog
+
- url: https://kittenlabs.de/index.xml
+
title: KittenLabs
+
- url: https://www.joshwcomeau.com/rss.xml
+
title: Josh Comeau's blog
+
- url: https://astro.build/rss.xml
+
title: The Astro Blog
+
- url: https://tailscale.com/blog/index.xml
+
title: Blog on Tailscale
+
- url: https://www.bungie.net/en/rss/News
+
title: Destiny 2
+
+
- type: twitch-channels
+
channels:
+
- jerma985
+
- jollywangcore
+
- northernlion
+
- porterrobinson
+
- rtgame
+
- schlatt
+
- vargskelethor
+
+
- size: full
+
widgets:
+
- type: search
+
search-engine: duckduckgo
+
bangs:
+
- title: YouTube
+
shortcut: "!yt"
+
url: https://www.youtube.com/results?search_query={QUERY}
+
- type: hacker-news
+
- type: videos
+
channels:
+
- UCQEnQfezywrAwkHWX_Uo_Qg # A Jolly Wangcore
+
- UCQ6fPy9wr7qnMxAbFOGBaLw # Computer Clan
+
- UC7Jwj9fkrf1adN4fMmTkpug # DankPods
+
- UCsBjURrPoezykLs9EqgamOA # Fireship
+
- UCR-DXc1voovS8nhAvccRZhg # Jeff Geerling
+
- UCRcgy6GzDeccI7dkbbBna3Q # LEMMiNO
+
- UCS5tt2z_DFvG7-39J3aE-bQ # Life of Boris
+
- UCXuqSBlHAE6Xw-yeJA0Tunw # Linus Tech Tips
+
- UCWyrVfwRL-2DOkzsqrbjo5Q # NCommander
+
- UC0fDG3byEcMtbOqPMymDNbw # Noclip
+
- UCZB6V9fUov0Mx_us3MWWILg # People Make Games
+
- UCKKKYE55BVswHgKihx5YXew # Porter Robinson
+
- UClY084mbGLK_SLlOfgizjow # SalC1
+
- UCQD3awTLw9i8Xzh85FKsuJA # SovietWomble
+
- UCBa659QWEk1AI4Tg--mrJ2A # Tom Scott
+
- UCHC4G4X-OR5WkY-IquRGa3Q # Tom Scott plus
+
+
- size: small
+
widgets:
+
- type: weather
+
hour-format: 24h
+
location: Almaty, Kazakhstan
+
+
- type: monitor
+
cache: 1m
+
title: Services
+
sites:
+
- title: Outline
+
url: https://wiki.sappho.systems
+
icon: https://gist.githubusercontent.com/SapphicMoe/06893190ae9df097c7a3a87afebaf7c9/raw/9a6df215b442a02d6bd1ea5581533f91cb66c1d0/test.svg
+
- title: Owncloud
+
url: https://cloud.sappho.systems
+
icon: si:owncloud
+
- title: Umami
+
url: https://umami.sappho.systems
+
icon: https://umami.sappho.systems/apple-touch-icon.png