Refactor user configuration to utilize secret-based management and remove deprecated environment files

This commit is contained in:
Chris Toph 2025-04-23 01:54:59 -04:00
parent 64fd35874e
commit 2e4db2b86c
12 changed files with 69 additions and 111 deletions

View file

@ -6,13 +6,17 @@
inputs, inputs,
... ...
}: }:
let
handle = config.hostSpec.handle;
email = config.hostSpec.email;
in
{ {
programs.git = { programs.git = {
enable = true; enable = true;
package = pkgs.gitAndTools.gitFull; package = pkgs.gitAndTools.gitFull;
userName = "[REDACTED]"; userName = handle;
userEmail = "[REDACTED]"; userEmail = email;
ignores = [ ignores = [
".csvignore" ".csvignore"

View file

@ -18,5 +18,5 @@
}; };
}; };
networking.[REDACTED] 22 ]; networking.firewall.allowedTCPPorts = [ 22 ];
} }

View file

@ -11,15 +11,15 @@
}: }:
let let
hostSpec = config.hostSpec.username; user = config.hostSpec.username;
default = { default = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --asterisks --time --time-format '%I:%M %p | %a %h | %F' --cmd uwsm start default"; command = "${pkgs.greetd.tuigreet}/bin/tuigreet --asterisks --time --time-format '%I:%M %p | %a %h | %F' --cmd uwsm start default";
user = "toph"; user = user;
}; };
initial = { initial = {
# command = "${pkgs.hyprland}/bin/Hyprland"; # command = "${pkgs.hyprland}/bin/Hyprland";
command = "uwsm start default"; command = "uwsm start default";
user = "toph"; user = user;
}; };
in in
{ {

View file

@ -14,6 +14,8 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
firewall = config.secretsSpec.firewall.cloud;
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -39,22 +41,16 @@ in
hostSpec = { hostSpec = {
hostName = "cloud"; hostName = "cloud";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {
enableIPv6 = false; enableIPv6 = false;
# Container Ports firewall.allowedTCPPorts = firewall.allowedTCPPorts;
[REDACTED]
80 # Caddy
443 # Caddy
[REDACTED]
];
}; };
## System-wide packages ## ## System-wide packages ##

View file

@ -14,6 +14,8 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
firewall = config.secretsSpec.firewall.komodo;
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -40,47 +42,19 @@ in
hostSpec = { hostSpec = {
hostName = "komodo"; hostName = "komodo";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {
enableIPv6 = false; enableIPv6 = false;
# Container Ports
firewall = { firewall = {
allowedTCPPorts = [ allowedTCPPorts = firewall.allowedTCPPorts;
[REDACTED] allowedTCPPortRanges = firewall.allowedTCPPortRanges;
[REDACTED] allowedUDPPorts = firewall.allowedUDPPorts;
[REDACTED]
222 # Forgejo SSH
[REDACTED]
[REDACTED]
[REDACTED]
[REDACTED]
[REDACTED]
8080 # File Browser
[REDACTED]
[REDACTED]
[REDACTED]
[REDACTED]
[REDACTED]
];
# Game Server Ports
allowedTCPPortRanges = [
{
[REDACTED]
[REDACTED]
}
];
allowedUDPPorts = [
8089 # Grafana
];
}; };
}; };
@ -91,12 +65,6 @@ in
compose2nix compose2nix
]; ];
# environment.etc = {
# "cloudflared/.keep" = {
# text = "This directory is used to store cloudflared configuration files.";
# };
# };
# https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion # https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.11"; system.stateVersion = "24.11";
} }

View file

@ -16,6 +16,7 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -35,12 +36,11 @@ in
hostSpec = { hostSpec = {
hostName = "lxc"; hostName = "lxc";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {

View file

@ -16,6 +16,7 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -37,12 +38,11 @@ in
hostSpec = { hostSpec = {
hostName = "nix"; hostName = "nix";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {
@ -54,12 +54,6 @@ in
# environment.systemPackages = with pkgs; [ # environment.systemPackages = with pkgs; [
# ]; # ];
# environment.etc = {
# "cloudflared/.keep" = {
# text = "This directory is used to store cloudflared configuration files.";
# };
# };
# https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion # https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.11"; system.stateVersion = "24.11";
} }

View file

@ -14,6 +14,8 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
firewall = config.secretsSpec.firewall.proxy;
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -39,22 +41,16 @@ in
hostSpec = { hostSpec = {
hostName = "proxy"; hostName = "proxy";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {
enableIPv6 = false; enableIPv6 = false;
# Container Ports firewall.allowedTCPPorts = firewall.allowedTCPPorts;
[REDACTED]
80 # Caddy
443 # Caddy
[REDACTED]
];
}; };
## System-wide packages ## ## System-wide packages ##

View file

@ -14,6 +14,7 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -53,12 +54,11 @@ in
hostSpec = { hostSpec = {
hostName = "rune"; hostName = "rune";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {

View file

@ -14,6 +14,7 @@
}: }:
let let
username = "toph"; username = "toph";
user = config.secretsSpec.users.${username};
in in
{ {
imports = lib.flatten [ imports = lib.flatten [
@ -45,12 +46,11 @@ in
hostSpec = { hostSpec = {
hostName = "vm"; hostName = "vm";
username = username; username = username;
handle = "tophC7"; password = user.password;
password = "[REDACTED]"; email = user.email;
[REDACTED]; handle = user.handle;
email = "[REDACTED]"; userFullName = user.fullName;
userFullName = "[REDACTED]"; isServer = true;
isARM = false;
}; };
networking = { networking = {

View file

@ -129,8 +129,8 @@ in
default = [ ]; default = [ ];
# example = [ # example = [
# { # {
# [REDACTED] # from = 25565;
# [REDACTED] # to = 25570;
# } # }
# ]; # ];
}; };
@ -162,8 +162,8 @@ in
default = [ ]; default = [ ];
# example = [ # example = [
# { # {
# [REDACTED] # from = 25565;
# [REDACTED] # to = 25570;
# } # }
# ]; # ];
}; };

View file

@ -20,20 +20,20 @@ sendon = success,error
; set to false to get full programm output via email ; set to false to get full programm output via email
short = true short = true
subject = [SnapRAID] Status Report: subject = [SnapRAID] Status Report:
from = [REDACTED] from =
to = [REDACTED] to =
; maximum email size in KiB ; maximum email size in KiB
maxsize = 500 maxsize = 500
[smtp] [smtp]
host = smtp.protonmail.ch host =
; leave empty for default port ; leave empty for default port
port = 587 port = 587
; set to "true" to activate ; set to "true" to activate
ssl = true ssl = true
tls = true tls = true
user = [REDACTED] user =
password = [REDACTED] password =
[scrub] [scrub]
; set to true to run scrub after sync ; set to true to run scrub after sync