mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 17:37:43 -04:00
Add linting, formatting, and CI
- Add deadnix, nixfmt, and statix to flake inputs - Add formatter output to flake for nix fmt support - Add deadnix, nixfmt, statix to Home Manager packages - Format all nix files with nixfmt - Add GitHub Actions workflow for CI validation - Support x86_64-darwin in formatter
This commit is contained in:
parent
1312755c4b
commit
c1a53997ce
75 changed files with 1417 additions and 767 deletions
|
|
@ -1,10 +1,18 @@
|
|||
{ inputs, config, pkgs, username, ... }: let
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
http_port = 80;
|
||||
https_port = 443;
|
||||
home_domain = "home.technicalissues.us";
|
||||
backend_ip = "127.0.0.1";
|
||||
restic_backup_time = "02:00";
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./containers/audiobookshelf.nix
|
||||
|
|
@ -31,7 +39,9 @@ in {
|
|||
};
|
||||
|
||||
environment = {
|
||||
sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; };
|
||||
sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "iHD";
|
||||
};
|
||||
systemPackages = with pkgs; [
|
||||
inputs.compose2nix.packages.${pkgs.stdenv.hostPlatform.system}.default
|
||||
docker-compose
|
||||
|
|
@ -57,7 +67,7 @@ in {
|
|||
intel-ocl # Generic OpenCL support
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
mailserver = {
|
||||
enable = true;
|
||||
enableImap = false;
|
||||
|
|
@ -81,26 +91,26 @@ in {
|
|||
# Open ports in the firewall.
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
22 # ssh
|
||||
80 # http to local Nginx
|
||||
443 # https to local Nginx
|
||||
3000 # PsiTransfer in oci-container
|
||||
3001 # immich-kiosk in compose
|
||||
3002 # grafana
|
||||
3005 # Firefly III
|
||||
3006 # Firefly III Data Importer
|
||||
3030 # Forgejo
|
||||
3087 # Youtarr in docker compose
|
||||
8001 # Tube Archivist
|
||||
8384 # Syncthing gui
|
||||
8888 # Atuin
|
||||
8090 # Wallabag in docker compose
|
||||
8945 # Pinchflat
|
||||
22 # ssh
|
||||
80 # http to local Nginx
|
||||
443 # https to local Nginx
|
||||
3000 # PsiTransfer in oci-container
|
||||
3001 # immich-kiosk in compose
|
||||
3002 # grafana
|
||||
3005 # Firefly III
|
||||
3006 # Firefly III Data Importer
|
||||
3030 # Forgejo
|
||||
3087 # Youtarr in docker compose
|
||||
8001 # Tube Archivist
|
||||
8384 # Syncthing gui
|
||||
8888 # Atuin
|
||||
8090 # Wallabag in docker compose
|
||||
8945 # Pinchflat
|
||||
13378 # Audiobookshelf in oci-container
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
1900 # Jellyfin service auto-discovery
|
||||
7359 # Jellyfin auto-discovery
|
||||
1900 # Jellyfin service auto-discovery
|
||||
7359 # Jellyfin auto-discovery
|
||||
];
|
||||
};
|
||||
# Or disable the firewall altogether.
|
||||
|
|
@ -112,11 +122,19 @@ in {
|
|||
networkmanager.enable = false;
|
||||
useNetworkd = true;
|
||||
vlans = {
|
||||
vlan23 = { id = 23; interface = "eno1"; };
|
||||
vlan23 = {
|
||||
id = 23;
|
||||
interface = "eno1";
|
||||
};
|
||||
};
|
||||
interfaces = {
|
||||
eno1.useDHCP = true;
|
||||
vlan23.ipv4.addresses = [{ address = "192.168.23.21"; prefixLength = 24; }];
|
||||
vlan23.ipv4.addresses = [
|
||||
{
|
||||
address = "192.168.23.21";
|
||||
prefixLength = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -311,7 +329,11 @@ in {
|
|||
"nix-tester.${home_domain}"
|
||||
];
|
||||
listen = [
|
||||
{ port = https_port; addr = "0.0.0.0"; ssl = true; }
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
|
|
@ -331,7 +353,13 @@ in {
|
|||
};
|
||||
};
|
||||
"ab.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -342,17 +370,41 @@ in {
|
|||
'';
|
||||
};
|
||||
"atuin.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
locations."/".proxyPass = "http://${backend_ip}:8888";
|
||||
};
|
||||
# budget.${home_domain}
|
||||
"${config.services.firefly-iii.virtualHost}".listen = [{ port = 3005; addr = "0.0.0.0"; ssl = false; }];
|
||||
"${config.services.firefly-iii-data-importer.virtualHost}".listen = [{ port = 3006; addr = "0.0.0.0"; ssl = false; }];
|
||||
"${config.services.firefly-iii.virtualHost}".listen = [
|
||||
{
|
||||
port = 3005;
|
||||
addr = "0.0.0.0";
|
||||
ssl = false;
|
||||
}
|
||||
];
|
||||
"${config.services.firefly-iii-data-importer.virtualHost}".listen = [
|
||||
{
|
||||
port = 3006;
|
||||
addr = "0.0.0.0";
|
||||
ssl = false;
|
||||
}
|
||||
];
|
||||
"git.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -362,7 +414,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"id.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -374,7 +432,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"immich.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -388,7 +452,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"immich-kiosk.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -403,7 +473,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"jellyfin.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -428,7 +504,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"mealie.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -438,7 +520,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"monitoring.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -469,7 +557,13 @@ in {
|
|||
'';
|
||||
};
|
||||
"readit.${home_domain}" = {
|
||||
listen = [{ port = https_port; addr = "0.0.0.0"; ssl = true; }];
|
||||
listen = [
|
||||
{
|
||||
port = https_port;
|
||||
addr = "0.0.0.0";
|
||||
ssl = true;
|
||||
}
|
||||
];
|
||||
enableACME = true;
|
||||
acmeRoot = null;
|
||||
forceSSL = true;
|
||||
|
|
@ -557,7 +651,7 @@ in {
|
|||
secrets = {
|
||||
firefly_app_key = {
|
||||
owner = config.services.firefly-iii.user;
|
||||
restartUnits = ["nginx.service"];
|
||||
restartUnits = [ "nginx.service" ];
|
||||
};
|
||||
firefly_pat_data_import = {
|
||||
owner = config.services.firefly-iii-data-importer.user;
|
||||
|
|
@ -582,7 +676,7 @@ in {
|
|||
};
|
||||
immich_kiosk_basic_auth = {
|
||||
owner = config.users.users.nginx.name;
|
||||
restartUnits = ["nginx.service"];
|
||||
restartUnits = [ "nginx.service" ];
|
||||
};
|
||||
local_git_config = {
|
||||
owner = "${username}";
|
||||
|
|
@ -594,12 +688,12 @@ in {
|
|||
};
|
||||
mealie = {
|
||||
mode = "0444";
|
||||
restartUnits = ["mealie.service"];
|
||||
restartUnits = [ "mealie.service" ];
|
||||
};
|
||||
nextcloud_admin_pass.owner = config.users.users.nextcloud.name;
|
||||
nginx_basic_auth = {
|
||||
owner = "nginx";
|
||||
restartUnits = ["nginx.service"];
|
||||
restartUnits = [ "nginx.service" ];
|
||||
};
|
||||
tailscale_key = {
|
||||
restartUnits = [ "tailscaled-autoconnect.service" ];
|
||||
|
|
@ -610,19 +704,24 @@ in {
|
|||
systemd.services = {
|
||||
jellyfin.environment.LIBVA_DRIVER_NAME = "iHD";
|
||||
"mealie" = {
|
||||
requires = ["postgresql.service"];
|
||||
after = ["postgresql.service"];
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
"nextcloud-setup" = {
|
||||
requires = ["postgresql.service"];
|
||||
after = ["postgresql.service"];
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = "Gene Liverman";
|
||||
extraGroups = [ "docker" "podman" "networkmanager" "wheel" ];
|
||||
extraGroups = [
|
||||
"docker"
|
||||
"podman"
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
linger = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue