treewide: format using nixfmt-rfc-style

This commit is contained in:
Leonardo Eugênio 2024-05-30 16:54:58 -03:00
parent dba047b845
commit 399eafe9ed
98 changed files with 1930 additions and 990 deletions

View file

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
imports = [
./vpsadminos.nix
inputs.agenix.nixosModules.default
@ -49,7 +55,12 @@
enable = true;
dates = "04:40";
operation = "switch";
flags = [ "--update-input" "nixpkgs" "--no-write-lock-file" "-L" ];
flags = [
"--update-input"
"nixpkgs"
"--no-write-lock-file"
"-L"
];
flake = "git+https://git.lelgenio.com/lelgenio/nixos-config#phantom";
};
@ -57,4 +68,3 @@
system.stateVersion = "23.05"; # Never change this
}

View file

@ -1,10 +1,14 @@
{ pkgs, inputs, config, ... }: {
{
pkgs,
inputs,
config,
...
}:
{
# It's important to let Digital Ocean set the hostname so we get rDNS to work
networking.hostName = "";
imports = [
inputs.nixos-mailserver.nixosModules.mailserver
];
imports = [ inputs.nixos-mailserver.nixosModules.mailserver ];
mailserver = {
enable = true;
@ -22,7 +26,11 @@
loginAccounts = {
"lelgenio@lelgenio.com" = {
hashedPassword = "$2y$05$z5s7QCXcs5uTFsfyYpwNJeWzb3RmzgWxNgcPCr0zjSytkLFF/qZmS";
aliases = [ "postmaster@lelgenio.com" "lelgenio@lelgenio.xyz" "lelgenio@lelgenio.xyz" ];
aliases = [
"postmaster@lelgenio.com"
"lelgenio@lelgenio.xyz"
"lelgenio@lelgenio.xyz"
];
};
"noreply@git.lelgenio.com" = {
hashedPassword = "$2b$05$TmR1R7ZwXfec7yrOfeBL7u3ZtyXf0up5dEO6uMWSvb/O7LPEm.j0.";
@ -50,5 +58,4 @@
$config['plugins'] = [ "carddav", "archive" ];
'';
};
}

View file

@ -1,4 +1,9 @@
{ lib, pkgs, config, ... }:
{
lib,
pkgs,
config,
...
}:
let
cfg = config.services.forgejo;
srv = cfg.settings.server;

View file

@ -1,7 +1,14 @@
{ config, pkgs, inputs, ... }: {
swapDevices = [{
device = "/swap/swapfile";
size = (1024 * 2); # 2 GB
}];
{
config,
pkgs,
inputs,
...
}:
{
swapDevices = [
{
device = "/swap/swapfile";
size = (1024 * 2); # 2 GB
}
];
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
services.mastodon = {
enable = true;
configureNginx = true;

View file

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
services.nextcloud = {
enable = true;
package = pkgs.nextcloud27;
@ -22,6 +28,4 @@
group = "nextcloud";
};
};
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, lib, ... }: {
{
config,
pkgs,
lib,
...
}:
{
services.nginx = {
enable = true;
recommendedProxySettings = true;
@ -8,21 +14,33 @@
};
# Redirect *lelgenio.xyz -> *lelgenio.com
services.nginx.virtualHosts = lib.mapAttrs'
(key: value: lib.nameValuePair "${key}lelgenio.xyz" value)
(
lib.genAttrs [ "" "social." "blog." "cloud." "mail." "git." "syncthing." ] (name: {
enableACME = true;
forceSSL = true;
locations."/".return = "301 $scheme://${name}lelgenio.com$request_uri";
})
);
services.nginx.virtualHosts =
lib.mapAttrs' (key: value: lib.nameValuePair "${key}lelgenio.xyz" value)
(
lib.genAttrs
[
""
"social."
"blog."
"cloud."
"mail."
"git."
"syncthing."
]
(name: {
enableACME = true;
forceSSL = true;
locations."/".return = "301 $scheme://${name}lelgenio.com$request_uri";
})
);
security.acme = {
acceptTerms = true;
defaults.email = "lelgenio@disroot.org";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedTCPPorts = [
80
443
];
}

View file

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
services.syncthing = {
enable = true;
@ -14,11 +20,10 @@
proxyPass = "http://127.0.0.1:8384";
extraConfig =
# required when the target is also TLS server with multiple hosts
"proxy_ssl_server_name on;" +
# required when the server wants to use HTTP Authentication
"proxy_pass_header Authorization;"
;
"proxy_ssl_server_name on;"
+
# required when the server wants to use HTTP Authentication
"proxy_pass_header Authorization;";
};
};
}

View file

@ -1,8 +1,12 @@
{ pkgs, ... }: {
{ pkgs, ... }:
{
security.rtkit.enable = true;
services.openssh = {
enable = true;
ports = [ 9022 22 ];
ports = [
9022
22
];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
@ -15,7 +19,15 @@
isNormalUser = true;
description = "Leonardo Eugênio";
hashedPassword = "$y$j9T$0e/rczjOVCy7PuwC3pG0V/$gTHZhfO4wQSlFvbDyfghbCnGI2uDI0a52zSrQ/yOA5A";
extraGroups = [ "networkmanager" "wheel" "docker" "adbusers" "bluetooth" "corectrl" "vboxusers" ];
extraGroups = [
"networkmanager"
"wheel"
"docker"
"adbusers"
"bluetooth"
"corectrl"
"vboxusers"
];
shell = pkgs.fish;
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxR/w+38b2lX90yNBqhq3mUmkn1WGu6GAPhN1tVp2ZjYRJNV/+5gWCnTtOWYtDx35HmK/spQ2Qy8X9ttkzORa24fysNx1Iqn/TiXhD7eIJjbGPnrOpIKTkW5/uB3SD/P5NBSa06//BaqJU4sBlG79hoXRpod052hQtdpTVDiMCIV+iboWPKqopmJJfWdBtVnHXs9rep0htPRExxGslImFk7Z6xjcaHyCpIQZPlOGf+sGsmUU7jRqzvZFV8ucIdbnAlMHrU4pepNFhuraESyZVTa/bi9sw0iozXp5Q5+5thMebEslmT1Z771kI4sieDy+O4r8c0Sx2/VY1UAzcpq1faggc3YB01MTh+tiEC6xdMvZLrQGL1NBWjHleMyL53GU5ERluC0vXJF3Hv3BGGBDfXWbrEm5n06DHr2apRVJGC0LwiQ7Woud1X4V4X1pKSusxCVMjT2lmcOwV6YhKhB2sowJc1OdMx4+tL0UWE+YKSZgBHfolwk6ml0F4EO9nnUHc= lelgenio@i15"
@ -32,7 +44,5 @@
programs.fish.enable = true;
environment.systemPackages = with pkgs; [
git
];
environment.systemPackages = with pkgs; [ git ];
}

View file

@ -6,7 +6,12 @@
#
# https://github.com/vpsfreecz/vpsadminos/blob/staging/os/lib/nixos-container/vpsadminos.nix
{ config, pkgs, lib, ... }:
{
config,
pkgs,
lib,
...
}:
with lib;
let
nameservers = [
@ -22,16 +27,19 @@ in
systemd.services.systemd-sysctl.enable = false;
systemd.services.systemd-oomd.enable = false;
systemd.sockets."systemd-journald-audit".enable = false;
systemd.mounts = [{ where = "/sys/kernel/debug"; enable = false; }];
systemd.mounts = [
{
where = "/sys/kernel/debug";
enable = false;
}
];
systemd.services.rpc-gssd.enable = false;
# Due to our restrictions in /sys, the default systemd-udev-trigger fails
# on accessing PCI devices, etc. Override it to match only network devices.
# In addition, boot.isContainer prevents systemd-udev-trigger.service from
# being enabled at all, so add it explicitly.
systemd.additionalUpstreamSystemUnits = [
"systemd-udev-trigger.service"
];
systemd.additionalUpstreamSystemUnits = [ "systemd-udev-trigger.service" ];
systemd.services.systemd-udev-trigger.serviceConfig.ExecStart = [
""
"-udevadm trigger --subsystem-match=net --action=add"

View file

@ -1,4 +1,10 @@
{ config, pkgs, inputs, ... }: {
{
config,
pkgs,
inputs,
...
}:
{
services.writefreely = {
enable = true;
acme.enable = true;
@ -22,4 +28,3 @@
};
};
}