Compare commits
12 Commits
baecc7bb69
...
restic
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2803b8e5c | ||
|
|
d11d6d7f78 | ||
|
|
ebfe340cf0 | ||
|
|
af26a2db8b | ||
|
|
34eaffdd65 | ||
|
|
fc66147173 | ||
|
|
3a84c99877 | ||
|
|
09dee82f8d | ||
|
|
0c4d651098 | ||
|
|
e218eb25f3 | ||
|
|
01d8e9c758 | ||
|
|
682bc9d826 |
@@ -7,7 +7,7 @@
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
_1password-shell-plugins.url = "github:1Password/shell-plugins";
|
||||
# _1password-shell-plugins.url = "github:1Password/shell-plugins";
|
||||
nixgl = {
|
||||
url = "github:nix-community/nixGL";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
./vscode.nix
|
||||
|
||||
../nixosModules/options.nix
|
||||
inputs._1password-shell-plugins.hmModules.default
|
||||
# inputs._1password-shell-plugins.hmModules.default
|
||||
# Commented out because it tries to configure fish shell which we don't use
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||
@@ -91,15 +92,15 @@
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# https://developer.1password.com/docs/cli/shell-plugins/nix/
|
||||
programs._1password-shell-plugins = lib.mkIf config._1password {
|
||||
# enable 1Password shell plugins for bash, zsh, and fish shell
|
||||
enable = true;
|
||||
# the specified packages as well as 1Password CLI will be
|
||||
# automatically installed and configured to use shell plugins
|
||||
# https://developer.1password.com/docs/cli/shell-plugins
|
||||
plugins = with pkgs; [ gh ];
|
||||
};
|
||||
# # https://developer.1password.com/docs/cli/shell-plugins/nix/
|
||||
# programs._1password-shell-plugins = lib.mkIf config._1password {
|
||||
# # enable 1Password shell plugins for bash, zsh, and fish shell
|
||||
# enable = true;
|
||||
# # the specified packages as well as 1Password CLI will be
|
||||
# # automatically installed and configured to use shell plugins
|
||||
# # https://developer.1password.com/docs/cli/shell-plugins
|
||||
# plugins = with pkgs; [ gh ];
|
||||
# };
|
||||
home.file.".config/1Password/ssh/agent.toml" = lib.mkIf config._1password {
|
||||
# https://developer.1password.com/docs/ssh/agent/config
|
||||
text = ''
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
};
|
||||
|
||||
# nixGL is now provided as a flake input
|
||||
nixGL.packages = nixgl.packages.${pkgs.system};
|
||||
nixGL.defaultWrapper = "mesa";
|
||||
nixGL.installScripts = [ "mesa" ];
|
||||
targets.genericLinux.nixGL = {
|
||||
packages = nixgl.packages.${pkgs.system};
|
||||
defaultWrapper = "mesa";
|
||||
installScripts = [ "mesa" ];
|
||||
};
|
||||
|
||||
programs.ghostty = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||
enable = true;
|
||||
@@ -19,7 +21,7 @@
|
||||
font-family = "Source Code Pro";
|
||||
# theme = "idleToes";
|
||||
# theme = "CGA";
|
||||
theme = "catppuccin-mocha";
|
||||
theme = "Catppuccin Mocha";
|
||||
# theme = "CobaltNext";
|
||||
# clipboard-read = "allow";
|
||||
copy-on-select = true;
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
programs.git = lib.mkMerge [
|
||||
{
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
settings = {
|
||||
credential.helper = "store --file ~/.git-credentials";
|
||||
init.defaultBranch = "main";
|
||||
push.autoSetupRemote = true;
|
||||
};
|
||||
}
|
||||
(lib.mkIf (config.profile == "personal") {
|
||||
userName = "John Lancaster";
|
||||
userEmail = "32917998+jsl12@users.noreply.github.com";
|
||||
settings.user.name = "John Lancaster";
|
||||
settings.user.email = "32917998+jsl12@users.noreply.github.com";
|
||||
})
|
||||
(lib.mkIf (config.profile == "work") {
|
||||
userName = "John Lancaster";
|
||||
userEmail = "john.lancaster@crowncastle.com";
|
||||
settings.user.name = "John Lancaster";
|
||||
settings.user.email = "john.lancaster@crowncastle.com";
|
||||
})
|
||||
];
|
||||
}
|
||||
@@ -59,6 +59,7 @@ in {
|
||||
rp schedule --all
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "rp-test" "rp run-schedule backup@default --dry-run")
|
||||
(pkgs.writeShellScriptBin "rp-test" "rp run-schedule backup@default --dry-run")
|
||||
];
|
||||
xdg.configFile."resticprofile/profiles.yaml".source = yamlFormat.generate "profiles" {
|
||||
version = "2";
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
] ++ lib.optional config._1password "1password";
|
||||
};
|
||||
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
|
||||
initContent = lib.mkIf config._1password ''
|
||||
if [ -f "${config.home.homeDirectory}/.config/op/plugins.sh" ]; then
|
||||
source ${config.home.homeDirectory}/.config/op/plugins.sh
|
||||
fi
|
||||
'';
|
||||
# initContent = lib.mkIf config._1password ''
|
||||
# if [ -f "${config.home.homeDirectory}/.config/op/plugins.sh" ]; then
|
||||
# source ${config.home.homeDirectory}/.config/op/plugins.sh
|
||||
# fi
|
||||
# '';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,9 +34,14 @@ in
|
||||
path = "${config.xdg.configHome}/sops-nix/gmail_api_credentials.json";
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
GMAIL_CREDS_PATH = "${config.xdg.configHome}/sops-nix/gmail_api_credentials.json";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
(writeShellScriptBin "edit-secrets" ''
|
||||
sops --config ${sopsConfigPath} ${sopsSecretsPath}
|
||||
${sops}/bin/sops --config ${sopsConfigPath} ${sopsSecretsPath}
|
||||
'')
|
||||
sops
|
||||
age
|
||||
|
||||
@@ -16,10 +16,18 @@
|
||||
hostname = "192.168.1.110";
|
||||
user = "root";
|
||||
};
|
||||
"hermes" = {
|
||||
hostname = "192.168.1.150";
|
||||
user = "root";
|
||||
};
|
||||
"panoptes" = {
|
||||
hostname = "192.168.1.107";
|
||||
user = "panoptes";
|
||||
};
|
||||
"panoptes-root" = {
|
||||
hostname = "192.168.1.107";
|
||||
user = "root";
|
||||
};
|
||||
"pve5070" = {
|
||||
hostname = "192.168.1.130";
|
||||
user = "root";
|
||||
|
||||
@@ -12,5 +12,6 @@ in
|
||||
nix flake update --flake $FLAKE --impure
|
||||
sudo nixos-rebuild switch --flake $FLAKE#${hostName} --impure
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "test-dns" (builtins.readFile ../scripts/test-dns.sh))
|
||||
];
|
||||
}
|
||||
110
scripts/test-dns.sh
Normal file
110
scripts/test-dns.sh
Normal file
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Function to test DNS resolution for a subdomain
|
||||
test_subdomain() {
|
||||
local subdomain="$1"
|
||||
local fqdn="${subdomain}.john-stream.com"
|
||||
|
||||
echo "========================================"
|
||||
echo "Testing DNS for: $fqdn"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
# Test panoptes
|
||||
echo "📍 Testing: panoptes"
|
||||
result=$(dig @panoptes "$fqdn" +short +time=2 +tries=1 2>&1)
|
||||
if [ -n "$result" ]; then
|
||||
echo " ✅ Resolved to: $result"
|
||||
dig @panoptes "$fqdn" +noall +answer +time=2 +tries=1 | sed 's/^/ /'
|
||||
else
|
||||
echo " ❌ Failed to resolve"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Test CoreDNS (192.168.1.107)
|
||||
echo "📍 Testing: 192.168.1.107 (CoreDNS)"
|
||||
result=$(dig @192.168.1.107 "$fqdn" +short +time=2 +tries=1 2>&1)
|
||||
if [ -n "$result" ]; then
|
||||
echo " ✅ Resolved to: $result"
|
||||
dig @192.168.1.107 "$fqdn" +noall +answer +time=2 +tries=1 | sed 's/^/ /'
|
||||
else
|
||||
echo " ❌ Failed to resolve"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Test Cloudflare DNS (1.1.1.1)
|
||||
echo "📍 Testing: 1.1.1.1 (Cloudflare DNS)"
|
||||
result=$(dig @1.1.1.1 "$fqdn" +short +time=2 +tries=1 2>&1)
|
||||
if [ -n "$result" ]; then
|
||||
echo " ✅ Resolved to: $result"
|
||||
dig @1.1.1.1 "$fqdn" +noall +answer +time=2 +tries=1 | sed 's/^/ /'
|
||||
else
|
||||
echo " ❌ Failed to resolve"
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Function to check SSL certificate for the domain
|
||||
check_ssl_cert() {
|
||||
local subdomain="$1"
|
||||
local fqdn="${subdomain}.john-stream.com"
|
||||
|
||||
echo "========================================"
|
||||
echo "SSL Certificate Check for: $fqdn"
|
||||
echo "========================================"
|
||||
echo ""
|
||||
|
||||
# Check if openssl is available
|
||||
if ! command -v openssl &> /dev/null; then
|
||||
echo "❌ openssl command not found. Please install openssl to check SSL certificates."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Try to fetch SSL certificate information
|
||||
echo "📍 Fetching SSL certificate information..."
|
||||
cert_info=$(echo | openssl s_client -servername "$fqdn" -connect "$fqdn:443" 2>/dev/null | openssl x509 -noout -text 2>/dev/null)
|
||||
|
||||
if [ -z "$cert_info" ]; then
|
||||
echo " ❌ Failed to retrieve SSL certificate. The domain may not be accessible via HTTPS."
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Extract and display key certificate information
|
||||
echo " ✅ SSL certificate found!"
|
||||
echo ""
|
||||
|
||||
# Get certificate details
|
||||
cert_details=$(echo | openssl s_client -servername "$fqdn" -connect "$fqdn:443" 2>/dev/null | openssl x509 -noout -subject -issuer -dates 2>/dev/null)
|
||||
|
||||
echo "📋 Certificate Details:"
|
||||
echo "$cert_details" | sed 's/^/ /'
|
||||
echo ""
|
||||
|
||||
# Check certificate expiration
|
||||
expiry_date=$(echo | openssl s_client -servername "$fqdn" -connect "$fqdn:443" 2>/dev/null | openssl x509 -noout -enddate 2>/dev/null | cut -d= -f2)
|
||||
|
||||
if [ -n "$expiry_date" ]; then
|
||||
expiry_epoch=$(date -d "$expiry_date" +%s 2>/dev/null)
|
||||
current_epoch=$(date +%s)
|
||||
days_until_expiry=$(( ($expiry_epoch - $current_epoch) / 86400 ))
|
||||
|
||||
if [ $days_until_expiry -lt 0 ]; then
|
||||
echo "⚠️ Certificate Status: EXPIRED ($days_until_expiry days ago)"
|
||||
elif [ $days_until_expiry -lt 30 ]; then
|
||||
echo "⚠️ Certificate Status: Expiring soon ($days_until_expiry days remaining)"
|
||||
else
|
||||
echo "✅ Certificate Status: Valid ($days_until_expiry days remaining)"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
# Test the subdomain
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <subdomain>"
|
||||
echo "Example: $0 appdaemon"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test_subdomain "$1"
|
||||
check_ssl_cert "$1"
|
||||
Reference in New Issue
Block a user