treewide: apply nixpkgs-fmt

Used command:
nixpkgs-fmt .
This commit is contained in:
teutat3s 2024-01-27 20:29:30 +01:00
parent 0c5a42cb67
commit 815033c764
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
43 changed files with 562 additions and 553 deletions

View file

@ -80,7 +80,8 @@
flake = flake =
let let
username = "barkeeper"; username = "barkeeper";
in { in
{
inherit username; inherit username;
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib;

View file

@ -1,5 +1,5 @@
{ self, ... }: { self, ... }:
{ {
flake = { flake = {
nixosConfigurations = { nixosConfigurations = {
nachtigall = self.nixos-flake.lib.mkLinuxSystem { nachtigall = self.nixos-flake.lib.mkLinuxSystem {
@ -25,4 +25,4 @@
}; };
}; };
}; };
} }

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: }:
{ {
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
@ -56,5 +55,5 @@
}; };
}; };
}; };
networking.firewall.allowedTCPPorts = [80 443]; networking.firewall.allowedTCPPorts = [ 80 443 ];
} }

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.drone-secrets = { age.secrets.drone-secrets = {
file = "${flake.self}/secrets/drone-secrets.age"; file = "${flake.self}/secrets/drone-secrets.age";
@ -25,18 +24,20 @@
isSystemUser = true; isSystemUser = true;
}; };
users.groups.drone = {}; users.groups.drone = { };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"d '/var/lib/drone-db' 0750 drone drone - -" "d '/var/lib/drone-db' 0750 drone drone - -"
]; ];
systemd.services."docker-network-drone" = let systemd.services."docker-network-drone" =
let
docker = config.virtualisation.oci-containers.backend; docker = config.virtualisation.oci-containers.backend;
dockerBin = "${pkgs.${docker}}/bin/${docker}"; dockerBin = "${pkgs.${docker}}/bin/${docker}";
in { in
{
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
before = ["docker-drone-server.service"]; before = [ "docker-drone-server.service" ];
script = '' script = ''
${dockerBin} network inspect drone-net >/dev/null 2>&1 || ${dockerBin} network create drone-net --subnet 172.20.0.0/24 ${dockerBin} network inspect drone-net >/dev/null 2>&1 || ${dockerBin} network create drone-net --subnet 172.20.0.0/24
''; '';
@ -73,7 +74,7 @@
ports = [ ports = [
"4000:80" "4000:80"
]; ];
dependsOn = ["drone-db"]; dependsOn = [ "drone-db" ];
extraOptions = [ extraOptions = [
"--network=drone-net" "--network=drone-net"
"--pull=always" "--pull=always"
@ -96,7 +97,7 @@
volumes = [ volumes = [
"/var/run/docker.sock:/var/run/docker.sock" "/var/run/docker.sock:/var/run/docker.sock"
]; ];
dependsOn = ["drone-db"]; dependsOn = [ "drone-db" ];
extraOptions = [ extraOptions = [
"--network=drone-net" "--network=drone-net"
"--pull=always" "--pull=always"

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.forgejo-actions-runner-token = { age.secrets.forgejo-actions-runner-token = {
file = "${flake.self}/secrets/forgejo-actions-runner-token.age"; file = "${flake.self}/secrets/forgejo-actions-runner-token.age";

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.grafana-admin-password = { age.secrets.grafana-admin-password = {
file = "${flake.self}/secrets/grafana-admin-password.age"; file = "${flake.self}/secrets/grafana-admin-password.age";

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
# source: https://gist.github.com/rickhull/895b0cb38fdd537c1078a858cf15d63e # source: https://gist.github.com/rickhull/895b0cb38fdd537c1078a858cf15d63e
# https://grafana.com/docs/loki/latest/configure/examples/#1-local-configuration-exampleyaml # https://grafana.com/docs/loki/latest/configure/examples/#1-local-configuration-exampleyaml

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.nachtigall-metrics-prometheus-basic-auth-password = { age.secrets.nachtigall-metrics-prometheus-basic-auth-password = {
file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age"; file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age";

View file

@ -1,12 +1,13 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
... }:
}: let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
in { in
{
config = { config = {
# Override nix.conf for more agressive garbage collection # Override nix.conf for more agressive garbage collection
nix.extraOptions = lib.mkForce '' nix.extraOptions = lib.mkForce ''

View file

@ -2,7 +2,8 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./configuration.nix ./configuration.nix
./triton-vmtools.nix ./triton-vmtools.nix

View file

@ -1,19 +1,18 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ { config
config, , lib
lib, , pkgs
pkgs, , modulesPath
modulesPath, , ...
...
}: { }: {
imports = []; imports = [ ];
boot.initrd.availableKernelModules = ["ahci" "virtio_pci" "xhci_pci" "sr_mod" "virtio_blk"]; boot.initrd.availableKernelModules = [ "ahci" "virtio_pci" "xhci_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [ ];
boot.kernelModules = []; boot.kernelModules = [ ];
boot.extraModulePackages = []; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-label/nixos"; device = "/dev/disk/by-label/nixos";
@ -35,7 +34,7 @@
]; ];
}; };
swapDevices = []; swapDevices = [ ];
networking.useDHCP = lib.mkDefault false; networking.useDHCP = lib.mkDefault false;
networking.networkmanager.enable = lib.mkForce false; networking.networkmanager.enable = lib.mkForce false;

View file

@ -1,7 +1,6 @@
{ { pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
flake.inputs.triton-vmtools.packages.${pkgs.system}.default flake.inputs.triton-vmtools.packages.${pkgs.system}.default

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , self
self, , ...
...
}: { }: {
services.nginx.virtualHosts."collabora.pub.solar" = { services.nginx.virtualHosts."collabora.pub.solar" = {
enableACME = true; enableACME = true;

View file

@ -1,4 +1,4 @@
{flake, config, lib, ...}: { flake, config, lib, ... }:
{ {
age.secrets."coturn-static-auth-secret" = { age.secrets."coturn-static-auth-secret" = {
file = "${flake.self}/secrets/coturn-static-auth-secret.age"; file = "${flake.self}/secrets/coturn-static-auth-secret.age";
@ -19,9 +19,10 @@
pkey = "${config.security.acme.certs.${realm}.directory}/key.pem"; pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";
extraConfig = extraConfig =
let let
externalIPv4s = lib.strings.concatMapStringsSep "\n" ({address, ...}: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv4.addresses; externalIPv4s = lib.strings.concatMapStringsSep "\n" ({ address, ... }: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv4.addresses;
externalIPv6s = lib.strings.concatMapStringsSep "\n" ({address, ...}: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv6.addresses; externalIPv6s = lib.strings.concatMapStringsSep "\n" ({ address, ... }: "external-ip=${address}") config.networking.interfaces.enp35s0.ipv6.addresses;
in '' in
''
${externalIPv4s} ${externalIPv4s}
${externalIPv6s} ${externalIPv6s}
@ -64,11 +65,12 @@
}; };
networking.firewall = { networking.firewall = {
interfaces.enp35s0 = let interfaces.enp35s0 =
range = with config.services.coturn; [ { let
range = with config.services.coturn; [{
from = min-port; from = min-port;
to = max-port; to = max-port;
} ]; }];
in in
{ {
allowedUDPPortRanges = range; allowedUDPPortRanges = range;

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.forgejo-database-password = { age.secrets.forgejo-database-password = {
file = "${flake.self}/secrets/forgejo-database-password.age"; file = "${flake.self}/secrets/forgejo-database-password.age";

View file

@ -1,9 +1,8 @@
{ { flake
flake, , config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
age.secrets.keycloak-database-password = { age.secrets.keycloak-database-password = {
file = "${flake.self}/secrets/keycloak-database-password.age"; file = "${flake.self}/secrets/keycloak-database-password.age";

View file

@ -1,12 +1,11 @@
{ { flake
flake, , config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: }:
{ {
networking.firewall.allowedTCPPorts = [25]; networking.firewall.allowedTCPPorts = [ 25 ];
users.users.nginx.extraGroups = [ "mailman" ]; users.users.nginx.extraGroups = [ "mailman" ];
@ -23,13 +22,13 @@
services.postfix = { services.postfix = {
enable = true; enable = true;
relayDomains = ["hash:/var/lib/mailman/data/postfix_domains"]; relayDomains = [ "hash:/var/lib/mailman/data/postfix_domains" ];
# get TLS certs for list.pub.solar from acme # get TLS certs for list.pub.solar from acme
sslCert = "/var/lib/acme/list.pub.solar/fullchain.pem"; sslCert = "/var/lib/acme/list.pub.solar/fullchain.pem";
sslKey = "/var/lib/acme/list.pub.solar/key.pem"; sslKey = "/var/lib/acme/list.pub.solar/key.pem";
config = { config = {
transport_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; transport_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ];
local_recipient_maps = ["hash:/var/lib/mailman/data/postfix_lmtp"]; local_recipient_maps = [ "hash:/var/lib/mailman/data/postfix_lmtp" ];
}; };
rootAlias = "admins@pub.solar"; rootAlias = "admins@pub.solar";
postmasterAlias = "admins@pub.solar"; postmasterAlias = "admins@pub.solar";
@ -38,34 +37,34 @@
systemd.paths.watcher-acme-ssl-file = { systemd.paths.watcher-acme-ssl-file = {
description = "Watches for changes in acme's TLS cert file (after renewals) to reload postfix"; description = "Watches for changes in acme's TLS cert file (after renewals) to reload postfix";
documentation = ["systemd.path(5)"]; documentation = [ "systemd.path(5)" ];
partOf = ["postfix-reload.service"]; partOf = [ "postfix-reload.service" ];
pathConfig = { pathConfig = {
PathChanged = "/var/lib/acme/list.pub.solar/fullchain.pem"; PathChanged = "/var/lib/acme/list.pub.solar/fullchain.pem";
Unit = "postfix-reload.service"; Unit = "postfix-reload.service";
}; };
wantedBy = ["multi-user.target"]; wantedBy = [ "multi-user.target" ];
}; };
systemd.services."postfix-reload" = { systemd.services."postfix-reload" = {
description = "Reloads postfix config, e.g. after TLS certs change, notified by watcher-acme-ssl-file.path"; description = "Reloads postfix config, e.g. after TLS certs change, notified by watcher-acme-ssl-file.path";
documentation = ["systemd.path(5)"]; documentation = [ "systemd.path(5)" ];
requires = ["postfix.service"]; requires = [ "postfix.service" ];
after = ["postfix.service"]; after = [ "postfix.service" ];
startLimitIntervalSec = 10; startLimitIntervalSec = 10;
startLimitBurst = 5; startLimitBurst = 5;
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
script = '' script = ''
${pkgs.systemd}/bin/systemctl reload postfix ${pkgs.systemd}/bin/systemctl reload postfix
''; '';
wantedBy = ["multi-user.target"]; wantedBy = [ "multi-user.target" ];
}; };
services.mailman = { services.mailman = {
enable = true; enable = true;
serve.enable = true; serve.enable = true;
hyperkitty.enable = true; hyperkitty.enable = true;
webHosts = ["list.pub.solar"]; webHosts = [ "list.pub.solar" ];
siteOwner = "admins@pub.solar"; siteOwner = "admins@pub.solar";
}; };

View file

@ -27,7 +27,7 @@
bug_report_endpoint_url = "https://element.io/bugreports/submit"; bug_report_endpoint_url = "https://element.io/bugreports/submit";
show_labs_settings = true; show_labs_settings = true;
room_directory = { room_directory = {
servers = ["matrix.org"]; servers = [ "matrix.org" ];
}; };
# TODO: This looks wrong # TODO: This looks wrong
enable_presence_by_hs_url = "\n"; enable_presence_by_hs_url = "\n";

View file

@ -1,4 +1,4 @@
{config, lib, pkgs, ...}: { config, lib, pkgs, ... }:
{ {
systemd.services.matrix-appservice-irc.serviceConfig.SystemCallFilter = lib.mkForce [ systemd.services.matrix-appservice-irc.serviceConfig.SystemCallFilter = lib.mkForce [
"@system-service @pkey" "@system-service @pkey"
@ -90,7 +90,8 @@
sendConnectionMessages = true; sendConnectionMessages = true;
ssl = true; ssl = true;
}; };
in { in
{
"irc.libera.chat" = lib.attrsets.recursiveUpdate commonConfig { "irc.libera.chat" = lib.attrsets.recursiveUpdate commonConfig {
name = "libera"; name = "libera";
dynamicChannels.groupId = "+libera.chat:localhost"; dynamicChannels.groupId = "+libera.chat:localhost";

View file

@ -59,7 +59,7 @@
bot_messages_as_notices = true; bot_messages_as_notices = true;
bridge_notices = { bridge_notices = {
default = false; default = false;
exceptions = []; exceptions = [ ];
}; };
command_prefix = "!tg"; command_prefix = "!tg";
delivery_error_reports = true; delivery_error_reports = true;
@ -84,13 +84,13 @@
}; };
federate_rooms = true; federate_rooms = true;
filter = { filter = {
list = []; list = [ ];
mode = "blacklist"; mode = "blacklist";
}; };
image_as_file_size = 10; image_as_file_size = 10;
initial_power_level_overrides = { initial_power_level_overrides = {
group = {}; group = { };
user = {}; user = { };
}; };
inline_images = false; inline_images = false;
max_document_size = 100; max_document_size = 100;
@ -112,15 +112,15 @@
public_portals = true; public_portals = true;
relaybot = { relaybot = {
authless_portals = true; authless_portals = true;
group_chat_invite = []; group_chat_invite = [ ];
ignore_own_incoming_events = true; ignore_own_incoming_events = true;
ignore_unbridged_group_chat = true; ignore_unbridged_group_chat = true;
private_chat = { private_chat = {
invite = []; invite = [ ];
message = "This is a Matrix bridge relaybot and does not support direct chats"; message = "This is a Matrix bridge relaybot and does not support direct chats";
state_changes = true; state_changes = true;
}; };
whitelist = []; whitelist = [ ];
whitelist_group_admins = true; whitelist_group_admins = true;
}; };
resend_bridge_info = false; resend_bridge_info = false;
@ -145,7 +145,7 @@
}; };
logging = { logging = {
formatters= { formatters = {
precise = { precise = {
format = "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"; format = "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s";
}; };
@ -156,7 +156,7 @@
formatter = "precise"; formatter = "precise";
}; };
}; };
loggers={ loggers = {
aiohttp.level = "WARNING"; aiohttp.level = "WARNING";
mau.level = "WARNING"; mau.level = "WARNING";
telethon.level = "WARNING"; telethon.level = "WARNING";

View file

@ -2,7 +2,8 @@
let let
publicDomain = "matrix.pub.solar"; publicDomain = "matrix.pub.solar";
serverDomain = "pub.solar"; serverDomain = "pub.solar";
in { in
{
age.secrets."matrix-synapse-signing-key" = { age.secrets."matrix-synapse-signing-key" = {
file = "${flake.self}/secrets/matrix-synapse-signing-key.age"; file = "${flake.self}/secrets/matrix-synapse-signing-key.age";
mode = "400"; mode = "400";
@ -41,8 +42,8 @@ in {
account_threepid_delegates.msisdn = ""; account_threepid_delegates.msisdn = "";
alias_creation_rules = [{ alias_creation_rules = [{
action = "allow"; action = "allow";
alias= "*"; alias = "*";
room_id = "*" ; room_id = "*";
user_id = "*"; user_id = "*";
}]; }];
allow_guest_access = false; allow_guest_access = false;
@ -69,14 +70,14 @@ in {
federation_rr_transactions_per_room_per_second = 50; federation_rr_transactions_per_room_per_second = 50;
forget_rooms_on_leave = true; forget_rooms_on_leave = true;
include_profile_data_on_invite = true; include_profile_data_on_invite = true;
instance_map = {}; instance_map = { };
limit_profile_requests_to_users_who_share_rooms = false; limit_profile_requests_to_users_who_share_rooms = false;
log_config = ./matrix-log-config.yaml; log_config = ./matrix-log-config.yaml;
max_spider_size = "10M"; max_spider_size = "10M";
max_upload_size = "50M"; max_upload_size = "50M";
media_storage_providers = []; media_storage_providers = [ ];
password_config = { password_config = {
enabled = false; enabled = false;
@ -87,67 +88,67 @@ in {
presence.enabled = true; presence.enabled = true;
push.include_content = false; push.include_content = false;
rc_admin_redaction= { rc_admin_redaction = {
burst_count = 50; burst_count = 50;
per_second = 1; per_second = 1;
}; };
rc_federation= { rc_federation = {
concurrent = 3; concurrent = 3;
reject_limit = 50; reject_limit = 50;
sleep_delay = 500; sleep_delay = 500;
sleep_limit = 10; sleep_limit = 10;
window_size = 1000; window_size = 1000;
}; };
rc_invites= { rc_invites = {
per_issuer= { per_issuer = {
burst_count = 10; burst_count = 10;
per_second = 0.3; per_second = 0.3;
}; };
per_room= { per_room = {
burst_count = 10; burst_count = 10;
per_second = 0.3; per_second = 0.3;
}; };
per_user= { per_user = {
burst_count = 5; burst_count = 5;
per_second = 0.003; per_second = 0.003;
}; };
}; };
rc_joins= { rc_joins = {
local= { local = {
burst_count = 10; burst_count = 10;
per_second = 0.1; per_second = 0.1;
}; };
remote= { remote = {
burst_count = 10; burst_count = 10;
per_second = 0.01; per_second = 0.01;
}; };
}; };
rc_login= { rc_login = {
account= { account = {
burst_count = 3; burst_count = 3;
per_second = 0.17; per_second = 0.17;
}; };
address= { address = {
burst_count = 3; burst_count = 3;
per_second = 0.17; per_second = 0.17;
}; };
failed_attempts= { failed_attempts = {
burst_count = 3; burst_count = 3;
per_second = 0.17; per_second = 0.17;
}; };
}; };
rc_message= { rc_message = {
burst_count = 10; burst_count = 10;
per_second = 0.2; per_second = 0.2;
}; };
rc_registration= { rc_registration = {
burst_count = 3; burst_count = 3;
per_second = 0.17; per_second = 0.17;
}; };
redaction_retention_period = "7d"; redaction_retention_period = "7d";
redis.enabled = false; redis.enabled = false;
registration_requires_token = false; registration_requires_token = false;
registrations_require_3pid = ["email"]; registrations_require_3pid = [ "email" ];
report_stats = false; report_stats = false;
require_auth_for_profile_requests = false; require_auth_for_profile_requests = false;
room_list_publication_rules = [{ room_list_publication_rules = [{
@ -159,8 +160,8 @@ in {
signing_key_path = "/run/agenix/matrix-synapse-signing-key"; signing_key_path = "/run/agenix/matrix-synapse-signing-key";
stream_writers = {}; stream_writers = { };
trusted_key_servers = [{ server_name = "matrix.org";}]; trusted_key_servers = [{ server_name = "matrix.org"; }];
turn_allow_guests = false; turn_allow_guests = false;
turn_uris = [ turn_uris = [

View file

@ -1,12 +1,12 @@
{ { flake
flake, , config
config, , lib
lib, , pkgs
pkgs, , ...
... }:
}: let let
localSettingsPHP = pkgs.writeScript "LocalSettings.php" '' localSettingsPHP = pkgs.writeScript "LocalSettings.php" ''
<?php <?php
# Protect against web entry # Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) { if ( !defined( 'MEDIAWIKI' ) ) {
exit; exit;
@ -154,7 +154,8 @@
uid = 986; uid = 986;
gid = 984; gid = 984;
in { in
{
age.secrets.mediawiki-database-password = { age.secrets.mediawiki-database-password = {
file = "${flake.self}/secrets/mediawiki-database-password.age"; file = "${flake.self}/secrets/mediawiki-database-password.age";
path = "/run/mediawiki/database-password"; path = "/run/mediawiki/database-password";

View file

@ -1,8 +1,7 @@
{ { config
config, , pkgs
pkgs, , flake
flake, , ...
...
}: }:
{ {
age.secrets."nextcloud-secrets" = { age.secrets."nextcloud-secrets" = {

View file

@ -46,10 +46,12 @@ in
least_conn; least_conn;
''; '';
servers = builtins.listToAttrs servers = builtins.listToAttrs
(map (i: { (map
(i: {
name = "unix:/run/mastodon-streaming/streaming-${toString i}.socket"; name = "unix:/run/mastodon-streaming/streaming-${toString i}.socket";
value = { }; value = { };
}) (lib.range 1 cfg.streamingProcesses)); })
(lib.range 1 cfg.streamingProcesses));
}; };
}; };
} }

View file

@ -14,7 +14,7 @@ let
"io.element.e2ee" = { "io.element.e2ee" = {
default = true; default = true;
secure_backup_required = false; secure_backup_required = false;
secure_backup_setup_methods = []; secure_backup_setup_methods = [ ];
}; };
"m.integrations" = { "m.integrations" = {
managers = [ managers = [
@ -128,7 +128,8 @@ in
port = 8448; port = 8448;
addr = "0.0.0.0"; addr = "0.0.0.0";
ssl = true; ssl = true;
} { }
{
port = 8448; port = 8448;
addr = "[::]"; addr = "[::]";
ssl = true; ssl = true;
@ -154,6 +155,6 @@ in
}; };
}; };
}; };
networking.firewall.allowedTCPPorts = [8448]; networking.firewall.allowedTCPPorts = [ 8448 ];
} }

View file

@ -22,17 +22,17 @@
forceSSL = true; forceSSL = true;
locations = { locations = {
# serve base domain pub.solar for mastodon.pub.solar # serve base domain pub.solar for mastodon.pub.solar
# https://masto.host/mastodon-usernames-different-from-the-domain-used-for-installation/ # https://masto.host/mastodon-usernames-different-from-the-domain-used-for-installation/
"/.well-known/host-meta" = { "/.well-known/host-meta" = {
extraConfig = '' extraConfig = ''
return 301 https://mastodon.pub.solar$request_uri; return 301 https://mastodon.pub.solar$request_uri;
''; '';
}; };
# Tailscale OIDC webfinger requirement plus Mastodon webfinger redirect # Tailscale OIDC webfinger requirement plus Mastodon webfinger redirect
"/.well-known/webfinger" = { "/.well-known/webfinger" = {
# Redirect requests that match /.well-known/webfinger?resource=* to Mastodon # Redirect requests that match /.well-known/webfinger?resource=* to Mastodon
extraConfig = '' extraConfig = ''
if ($arg_resource) { if ($arg_resource) {
return 301 https://mastodon.pub.solar$request_uri; return 301 https://mastodon.pub.solar$request_uri;

View file

@ -1,13 +1,14 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , self
self, , ...
... }:
}: let let
acmeEmailAddress = "admins@pub.solar"; acmeEmailAddress = "admins@pub.solar";
webserverGroup = "hakkonaut"; webserverGroup = "hakkonaut";
in { in
{
services.nginx = { services.nginx = {
enable = true; enable = true;
group = webserverGroup; group = webserverGroup;
@ -30,5 +31,5 @@ in {
defaults.email = acmeEmailAddress; defaults.email = acmeEmailAddress;
}; };
networking.firewall.allowedTCPPorts = [80 443]; networking.firewall.allowedTCPPorts = [ 80 443 ];
} }

View file

@ -1,9 +1,8 @@
{ { flake
flake, , config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: { }: {
services.nginx.virtualHosts."stream.pub.solar" = { services.nginx.virtualHosts."stream.pub.solar" = {
enableACME = true; enableACME = true;

View file

@ -1,6 +1,5 @@
{ { config
config, , ...
...
}: { }: {
services.prometheus = { services.prometheus = {
exporters = { exporters = {

View file

@ -1,9 +1,8 @@
{ { config
config, , lib
lib, , pkgs
pkgs, , flake
flake, , ...
...
}: { }: {
age.secrets.nachtigall-metrics-prometheus-basic-auth-password = { age.secrets.nachtigall-metrics-prometheus-basic-auth-password = {
file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age"; file = "${flake.self}/secrets/nachtigall-metrics-prometheus-basic-auth-password.age";

View file

@ -1,9 +1,8 @@
{ { flake
flake, , config
config, , lib
lib, , pkgs
pkgs, , ...
...
}: }:
{ {
age.secrets.searx-environment = { age.secrets.searx-environment = {

View file

@ -1,8 +1,7 @@
{ { flake
flake, , config
config, , pkgs
pkgs, , ...
...
}: { }: {
# Use GRUB2 as the boot loader. # Use GRUB2 as the boot loader.
# We don't use systemd-boot because Hetzner uses BIOS legacy boot. # We don't use systemd-boot because Hetzner uses BIOS legacy boot.

View file

@ -2,7 +2,8 @@
{ {
imports = imports =
[ # Include the results of the hardware scan. [
# Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
./configuration.nix ./configuration.nix

View file

@ -5,7 +5,8 @@
{ {
imports = imports =
[ (modulesPath + "/installer/scan/not-detected.nix") [
(modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "ahci" "nvme" ]; boot.initrd.availableKernelModules = [ "ahci" "nvme" ];
@ -14,32 +15,38 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "root_pool/root"; {
device = "root_pool/root";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var/lib" = fileSystems."/var/lib" =
{ device = "root_pool/data"; {
device = "root_pool/data";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var/lib/postgresql" = fileSystems."/var/lib/postgresql" =
{ device = "root_pool/data/postgresql"; {
device = "root_pool/data/postgresql";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/var/lib/docker" = fileSystems."/var/lib/docker" =
{ device = "root_pool/data/docker"; {
device = "root_pool/data/docker";
fsType = "zfs"; fsType = "zfs";
}; };
fileSystems."/boot1" = fileSystems."/boot1" =
{ device = "/dev/disk/by-uuid/5493-EFF5"; {
device = "/dev/disk/by-uuid/5493-EFF5";
fsType = "vfat"; fsType = "vfat";
}; };
fileSystems."/boot2" = fileSystems."/boot2" =
{ device = "/dev/disk/by-uuid/5494-BA1E"; {
device = "/dev/disk/by-uuid/5494-BA1E";
fsType = "vfat"; fsType = "vfat";
}; };

View file

@ -18,4 +18,4 @@ let
}; };
}; };
in in
flake flake

View file

@ -1,4 +1,5 @@
{...}: let { ... }:
let
inherit (default.inputs.nixos) lib; inherit (default.inputs.nixos) lib;
host = configs.${hostname} or configs.PubSolarOS; host = configs.${hostname} or configs.PubSolarOS;
@ -6,4 +7,4 @@
default = (import ../.).defaultNix; default = (import ../.).defaultNix;
hostname = lib.fileContents /etc/hostname; hostname = lib.fileContents /etc/hostname;
in in
host host

View file

@ -1,9 +1,11 @@
{ self, lib, inputs, ... }: { { self, lib, inputs, ... }: {
# Configuration common to all Linux systems # Configuration common to all Linux systems
flake = { flake = {
lib = let lib =
callLibs = file: import file {inherit lib;}; let
in rec { callLibs = file: import file { inherit lib; };
in
rec {
## Define your own library functions here! ## Define your own library functions here!
#id = x: x; #id = x: x;
## Or in files, containing functions that take {lib} ## Or in files, containing functions that take {lib}

View file

@ -5,7 +5,8 @@
* Licensed under the MIT license * Licensed under the MIT license
*/ */
{ lib, inputs }: let { lib, inputs }:
let
# https://github.com/serokell/deploy-rs#overall-usage # https://github.com/serokell/deploy-rs#overall-usage
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import inputs.nixpkgs { inherit system; }; pkgs = import inputs.nixpkgs { inherit system; };
@ -16,7 +17,8 @@
(self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; }) (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; })
]; ];
}; };
getFqdn = c: let getFqdn = c:
let
net = c.config.networking; net = c.config.networking;
fqdn = fqdn =
if (net ? domain) && (net.domain != null) if (net ? domain) && (net.domain != null)
@ -24,7 +26,8 @@
else net.hostName; else net.hostName;
in in
fqdn; fqdn;
in { in
{
mkDeployNodes = systemConfigurations: extraConfig: mkDeployNodes = systemConfigurations: extraConfig:
/* /*
* *

View file

@ -1,9 +1,8 @@
{ { config
config, , pkgs
pkgs, , lib
lib, , flake
flake, , ...
...
}: { }: {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
]; ];
@ -26,9 +25,9 @@
# Prevents impurities in builds # Prevents impurities in builds
sandbox = true; sandbox = true;
# Give root and @wheel special privileges with nix # Give root and @wheel special privileges with nix
trusted-users = ["root" "@wheel"]; trusted-users = [ "root" "@wheel" ];
# Allow only group wheel to connect to the nix daemon # Allow only group wheel to connect to the nix daemon
allowed-users = ["@wheel"]; allowed-users = [ "@wheel" ];
}; };
# Generally useful nix option defaults # Generally useful nix option defaults

View file

@ -2,11 +2,11 @@
users.users.${flake.self.username} = { users.users.${flake.self.username} = {
name = flake.self.username; name = flake.self.username;
group = flake.self.username; group = flake.self.username;
extraGroups = ["wheel" "docker"]; extraGroups = [ "wheel" "docker" ];
isNormalUser = true; isNormalUser = true;
openssh.authorizedKeys.keys = flake.self.publicKeys.admins; openssh.authorizedKeys.keys = flake.self.publicKeys.admins;
}; };
users.groups.${flake.self.username} = {}; users.groups.${flake.self.username} = { };
# TODO: Remove when we stop locking ourselves out. # TODO: Remove when we stop locking ourselves out.
users.users.root.openssh.authorizedKeys.keys = flake.self.publicKeys.admins; users.users.root.openssh.authorizedKeys.keys = flake.self.publicKeys.admins;
@ -22,7 +22,7 @@
openssh.authorizedKeys.keys = flake.self.publicKeys.robots; openssh.authorizedKeys.keys = flake.self.publicKeys.robots;
}; };
users.groups.hakkonaut = {}; users.groups.hakkonaut = { };
users.users.root.initialHashedPassword = "$y$j9T$bIN6GjQkmPMllOcQsq52K0$q0Z5B5.KW/uxXK9fItB8H6HO79RYAcI/ZZdB0Djke32"; users.users.root.initialHashedPassword = "$y$j9T$bIN6GjQkmPMllOcQsq52K0$q0Z5B5.KW/uxXK9fItB8H6HO79RYAcI/ZZdB0Djke32";

View file

@ -1,7 +1,6 @@
{ { self
self, , inputs
inputs, , ...
...
}: { }: {
flake = { flake = {
nixosModules = rec { nixosModules = rec {

View file

@ -1,4 +1,4 @@
{lib, ...}: { lib, ... }:
{ {
flake = { flake = {
publicKeys = { publicKeys = {

View file

@ -24,7 +24,8 @@ let
flora6Keys = [ flora6Keys = [
flora-6-host flora-6-host
]; ];
in { in
{
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBB5XaH02a6+TchnyQED2VwaltPgeFCbildbE2h6nF5e root@nachtigall # ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBB5XaH02a6+TchnyQED2VwaltPgeFCbildbE2h6nF5e root@nachtigall
"nachtigall-root-ssh-key.age".publicKeys = nachtigallKeys ++ baseKeys; "nachtigall-root-ssh-key.age".publicKeys = nachtigallKeys ++ baseKeys;