Run nixfmt-rfc-style on repository and add it to Zed config

This commit is contained in:
Jo 2025-05-26 18:06:37 +02:00
parent f5e5adb2fd
commit 45494079c5
41 changed files with 441 additions and 240 deletions

View file

@ -3,18 +3,22 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkEnableOption mkIf types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.services.atticd;
in {
in
{
options.${namespace}.services.atticd = {
enable = mkEnableOption "the attic service, a multi-tenant nix binary cache.";
sopsFile = mkOpt types.path null "The location of the sops secret file for the Atticd service.";
sopsFormat = mkOpt types.str null "The format of the sops secret file for the Atticd service.";
subdomain = mkOpt types.str "cache" "The subdomain, of the system domain, the service should be exposed on.";
subdomain =
mkOpt types.str "cache"
"The subdomain, of the system domain, the service should be exposed on.";
};
config = mkIf cfg.enable {
@ -30,7 +34,7 @@ in {
settings = {
listen = "[::]:3900";
jwt = {};
jwt = { };
chunking = {
nar-size-threshold = 64 * 1024; # 64 KiB
@ -50,9 +54,9 @@ in {
services.traefik.dynamicConfigOptions = {
http = {
services.atticd.loadBalancer.servers = [{url = "http://localhost:3900";}];
services.atticd.loadBalancer.servers = [ { url = "http://localhost:3900"; } ];
routers.atticd = {
entryPoints = ["websecure"];
entryPoints = [ "websecure" ];
service = "atticd";
rule = "Host(`${cfg.subdomain}.${config.${namespace}.services.domain}`)";
};

View file

@ -2,13 +2,17 @@
lib,
self,
...
}: let
}:
let
inherit (lib) types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
in {
in
{
options.${namespace}.services = {
domain = mkOpt types.str "thevoid.cafe" "The main system domain, used for exposing services.";
mail = mkOpt types.str "system@thevoid.cafe" "The main system administration E-Mail, used for logs and services.";
mail =
mkOpt types.str "system@thevoid.cafe"
"The main system administration E-Mail, used for logs and services.";
};
}

View file

@ -3,12 +3,14 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkIf mkEnableOption;
inherit (self) namespace;
cfg = config.${namespace}.services.docker;
in {
in
{
options.${namespace}.services.docker = {
enable = mkEnableOption "the docker service.";
};

View file

@ -3,13 +3,15 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkEnableOption mkIf types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.services.duckdns;
in {
in
{
options.${namespace}.services.duckdns = {
enable = mkEnableOption "DuckDNS, the dynamic dns service. Will periodically refresh your IP.";
sopsFile = mkOpt types.path null "The location of the sops secret file for the DuckDNS service.";

View file

@ -1,4 +1,5 @@
{...}: {
{ ... }:
{
# Todo: rewrite as recursive operation, based on ${namespace}.users
system.userActivationScripts = {
removeConflictingHomeManagerBackups = {

View file

@ -3,17 +3,23 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkEnableOption mkIf types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.services.homepage;
in {
in
{
options.${namespace}.services.homepage = {
enable = mkEnableOption "Homepage, an intuitive dashboard for your services.";
subdomain = mkOpt types.str "home" "The subdomain, of the system domain, the service should be exposed on.";
configDir = mkOpt types.path null "The config directory, which will be copied to the Homepage directory during compilation.";
subdomain =
mkOpt types.str "home"
"The subdomain, of the system domain, the service should be exposed on.";
configDir =
mkOpt types.path null
"The config directory, which will be copied to the Homepage directory during compilation.";
};
config = mkIf cfg.enable {
@ -35,7 +41,9 @@ in {
labels = {
"traefik.enable" = "true";
"traefik.http.routers.homepage.entrypoints" = "websecure";
"traefik.http.routers.homepage.rule" = "Host(`${cfg.subdomain}.${config.${namespace}.services.domain}`)";
"traefik.http.routers.homepage.rule" = "Host(`${cfg.subdomain}.${
config.${namespace}.services.domain
}`)";
"traefik.http.services.homepage.loadbalancer.server.port" = "3000";
};
volumes = [
@ -48,7 +56,7 @@ in {
environment = {
"HOMEPAGE_ALLOWED_HOSTS" = "${cfg.subdomain}.${config.${namespace}.services.domain}";
};
extraOptions = ["--network=proxy"];
extraOptions = [ "--network=proxy" ];
};
};
}

View file

@ -3,13 +3,15 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkEnableOption mkIf types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.services.traefik;
in {
in
{
options.${namespace}.services.traefik = {
enable = mkEnableOption "the Traefik service.";
sopsFile = mkOpt types.path null "The location of the sops secret file for the Traefik service.";
@ -17,7 +19,11 @@ in {
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [80 8080 443]; # http, dashboard, https
networking.firewall.allowedTCPPorts = [
80
8080
443
]; # http, dashboard, https
sops.secrets."services/traefik" = {
sopsFile = cfg.sopsFile;
@ -26,7 +32,7 @@ in {
systemd.services.traefik = {
serviceConfig = {
EnvironmentFile = [config.sops.secrets."services/traefik".path];
EnvironmentFile = [ config.sops.secrets."services/traefik".path ];
};
};
@ -84,11 +90,11 @@ in {
domains = [
{
main = "thevoid.cafe";
sans = ["*.thevoid.cafe"];
sans = [ "*.thevoid.cafe" ];
}
{
main = "rhysbot.co.uk";
sans = ["*.rhysbot.co.uk"];
sans = [ "*.rhysbot.co.uk" ];
}
];
};

View file

@ -3,18 +3,24 @@
self,
config,
...
}: let
}:
let
inherit (lib) mkEnableOption mkIf types;
inherit (self) namespace;
inherit (self.lib) mkOpt;
cfg = config.${namespace}.services.vaultwarden;
in {
in
{
options.${namespace}.services.vaultwarden = {
enable = mkEnableOption "Vaultwarden, a self-hostable password manager.";
sopsFile = mkOpt types.path null "The location of the sops secret file for the Vaultwarden service.";
sopsFile =
mkOpt types.path null
"The location of the sops secret file for the Vaultwarden service.";
sopsFormat = mkOpt types.str null "The format of the sops secret file for the Vaultwarden service.";
subdomain = mkOpt types.str "vault" "The subdomain, of the system domain, the service should be exposed on.";
subdomain =
mkOpt types.str "vault"
"The subdomain, of the system domain, the service should be exposed on.";
};
config = mkIf cfg.enable {
@ -35,7 +41,9 @@ in {
labels = {
"traefik.enable" = "true";
"traefik.http.routers.vaultwarden.entrypoints" = "websecure";
"traefik.http.routers.vaultwarden.rule" = "Host(`${cfg.subdomain}.${config.${namespace}.services.domain}`)";
"traefik.http.routers.vaultwarden.rule" = "Host(`${cfg.subdomain}.${
config.${namespace}.services.domain
}`)";
};
volumes = [
"/var/lib/containers/vaultwarden/data:/data:rw"
@ -43,7 +51,7 @@ in {
environmentFiles = [
config.sops.secrets."services/vaultwarden".path
];
extraOptions = ["--network=proxy"];
extraOptions = [ "--network=proxy" ];
};
};
}