Reformat with alejandra
This commit is contained in:
parent
7b2b5b3b80
commit
52a81ddb21
53 changed files with 764 additions and 746 deletions
|
|
@ -1,70 +1,72 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = config.constants.postMaster;
|
||||
virtualHosts =
|
||||
let
|
||||
dn = config.constants.domain;
|
||||
homeSrv = s: "nebula:${portStr.${s}}";
|
||||
localSrv = s: "${config.constants.localhost}:${portStr.${s}}";
|
||||
msfqdn = config.mailserver.fqdn;
|
||||
mtfqdn = "matrix.${dn}";
|
||||
portStr = builtins.mapAttrs (n: v: toString v) config.constants.port;
|
||||
wn = s: "/.well-known/${s}";
|
||||
in
|
||||
{
|
||||
"${dn}".extraConfig = let wnm = wn "matrix"; in ''
|
||||
header ${wnm}/* Content-Type application/json
|
||||
header ${wnm}/* Access-Control-Allow-Origin *
|
||||
respond ${wnm}/server `{ "m.server": "${mtfqdn}:${portStr.https}" }`
|
||||
respond ${wnm}/client `{
|
||||
"m.homeserver": { "base_url": "https://${mtfqdn}" },
|
||||
"m.identity_server": { "base_url": "https://${mtfqdn}" }
|
||||
}`
|
||||
'';
|
||||
"aria2.${dn}".extraConfig = ''
|
||||
reverse_proxy /jsonrpc ${homeSrv "aria2"}
|
||||
file_server {
|
||||
root ${pkgs.ariang}/share/ariang
|
||||
virtualHosts = let
|
||||
dn = config.constants.domain;
|
||||
homeSrv = s: "nebula:${portStr.${s}}";
|
||||
localSrv = s: "${config.constants.localhost}:${portStr.${s}}";
|
||||
msfqdn = config.mailserver.fqdn;
|
||||
mtfqdn = "matrix.${dn}";
|
||||
portStr = builtins.mapAttrs (n: v: toString v) config.constants.port;
|
||||
wn = s: "/.well-known/${s}";
|
||||
in {
|
||||
"${dn}".extraConfig = let
|
||||
wnm = wn "matrix";
|
||||
in ''
|
||||
header ${wnm}/* Content-Type application/json
|
||||
header ${wnm}/* Access-Control-Allow-Origin *
|
||||
respond ${wnm}/server `{ "m.server": "${mtfqdn}:${portStr.https}" }`
|
||||
respond ${wnm}/client `{
|
||||
"m.homeserver": { "base_url": "https://${mtfqdn}" },
|
||||
"m.identity_server": { "base_url": "https://${mtfqdn}" }
|
||||
}`
|
||||
'';
|
||||
"aria2.${dn}".extraConfig = ''
|
||||
reverse_proxy /jsonrpc ${homeSrv "aria2"}
|
||||
file_server {
|
||||
root ${pkgs.ariang}/share/ariang
|
||||
}
|
||||
'';
|
||||
"forgejo.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "forgejo"}
|
||||
'';
|
||||
"headscale.${dn}".extraConfig = ''
|
||||
reverse_proxy ${localSrv "headscale"}
|
||||
'';
|
||||
"jellyfin.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "jellyfin"}
|
||||
'';
|
||||
"jellyseerr.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "jellyseerr"}
|
||||
'';
|
||||
${msfqdn} = {
|
||||
extraConfig = ''
|
||||
file_server ${wn "acme-challenge"}/* {
|
||||
root ${config.security.acme.defaults.webroot}/
|
||||
}
|
||||
'';
|
||||
"forgejo.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "forgejo"}
|
||||
'';
|
||||
"headscale.${dn}".extraConfig = ''
|
||||
reverse_proxy ${localSrv "headscale"}
|
||||
'';
|
||||
"jellyfin.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "jellyfin"}
|
||||
'';
|
||||
"jellyseerr.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "jellyseerr"}
|
||||
'';
|
||||
${msfqdn} = {
|
||||
extraConfig = ''
|
||||
file_server ${wn "acme-challenge"}/* {
|
||||
root ${config.security.acme.defaults.webroot}/
|
||||
}
|
||||
'';
|
||||
useACMEHost = msfqdn;
|
||||
};
|
||||
"matrix.${dn}".extraConfig = ''
|
||||
reverse_proxy /_matrix/* ${homeSrv "conduit"}
|
||||
file_server {
|
||||
root ${pkgs.cinny}
|
||||
}
|
||||
'';
|
||||
"vault.${dn}".extraConfig = ''
|
||||
reverse_proxy ${localSrv "vault"} {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
"writefreely.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "writefreely"}
|
||||
'';
|
||||
useACMEHost = msfqdn;
|
||||
};
|
||||
"matrix.${dn}".extraConfig = ''
|
||||
reverse_proxy /_matrix/* ${homeSrv "conduit"}
|
||||
file_server {
|
||||
root ${pkgs.cinny}
|
||||
}
|
||||
'';
|
||||
"vault.${dn}".extraConfig = ''
|
||||
reverse_proxy ${localSrv "vault"} {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
'';
|
||||
"writefreely.${dn}".extraConfig = ''
|
||||
reverse_proxy ${homeSrv "writefreely"}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
security.acme = {
|
||||
|
|
@ -74,5 +76,4 @@
|
|||
webroot = "/var/lib/acme/acme-challenge";
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
|
||||
{...}: {
|
||||
boot = {
|
||||
tmp.cleanOnBoot = true;
|
||||
loader.grub.device = "/dev/sda";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
{inputs, ...}: {
|
||||
imports = with inputs; [
|
||||
mailserver.nixosModules.default
|
||||
../../common
|
||||
|
|
|
|||
|
|
@ -1,28 +1,34 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [(modulesPath + "/profiles/qemu-guest.nix")];
|
||||
|
||||
# boot.initrd.availableKernelModules =
|
||||
# [ "ata_piix" "virtio_pci" "virtio_scsi" "sd_mod" ];
|
||||
# boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelModules = [];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
# fileSystems."/" = {
|
||||
# device = "/dev/disk/by-uuid/6d3bf8cd-1996-45fb-";
|
||||
# fsType = "ext4";
|
||||
# };
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||
boot.initrd.kernelModules = [ "nvme" ];
|
||||
fileSystems."/" = { device = "/dev/sda3"; fsType = "ext4"; };
|
||||
boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi"];
|
||||
boot.initrd.kernelModules = ["nvme"];
|
||||
fileSystems."/" = {
|
||||
device = "/dev/sda3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
|
||||
swapDevices = [ ];
|
||||
swapDevices = [];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
{config, ...}: {
|
||||
services = {
|
||||
headscale = with config.constants; {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,21 @@
|
|||
{ config, ... }:
|
||||
|
||||
let
|
||||
{config, ...}: let
|
||||
dn = config.constants.domain;
|
||||
usr = config.constants.userName;
|
||||
mailSecret = "mail/${usr}/password";
|
||||
in
|
||||
{
|
||||
in {
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = "mail.${dn}";
|
||||
domains = [ dn ];
|
||||
domains = [dn];
|
||||
|
||||
loginAccounts = {
|
||||
"${usr}@${dn}" = {
|
||||
aliases = [ config.constants.postMaster ];
|
||||
aliases = [config.constants.postMaster];
|
||||
hashedPasswordFile = config.sops.secrets.${mailSecret}.path;
|
||||
};
|
||||
};
|
||||
|
||||
certificateScheme = "acme";
|
||||
};
|
||||
sops.secrets.${mailSecret} = { };
|
||||
sops.secrets.${mailSecret} = {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{ config, ... }:
|
||||
|
||||
let hn = config.networking.hostName; in {
|
||||
{config, ...}: let
|
||||
hn = config.networking.hostName;
|
||||
in {
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = with config.constants.port; [ http https ];
|
||||
firewall.allowedTCPPorts = with config.constants.port; [http https];
|
||||
hostId = "2cadb253";
|
||||
nftables.enable = true;
|
||||
};
|
||||
|
|
@ -16,5 +16,5 @@ let hn = config.networking.hostName; in {
|
|||
openssh.enable = true;
|
||||
};
|
||||
|
||||
sops.secrets."cloudflare/${hn}" = { };
|
||||
sops.secrets."cloudflare/${hn}" = {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
{config, ...}: {
|
||||
services.vaultwarden = {
|
||||
enable = true;
|
||||
config = let const = config.constants; in {
|
||||
config = let
|
||||
const = config.constants;
|
||||
in {
|
||||
# Disable signup
|
||||
SIGNUPS_ALLOWED = false;
|
||||
# Specify service port
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue