Repository navigation
fix(dotfiles-updater): add missing PATH dependencies for Linux systemd service #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b8b7f47
a9b8bb3
4b70b44
2009871
0e3fe34
e04a30c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,14 @@ | |||||
| extraOptions = { | ||||||
| IgnoreUnknown = "UseKeychain"; | ||||||
| UseKeyChain = "yes"; | ||||||
| # Enable post-quantum key exchange algorithms | ||||||
| # sntrup761x25519 is a hybrid post-quantum algorithm combining | ||||||
| # Streamlined NTRU Prime (sntrup761) with X25519 | ||||||
| KexAlgorithms = "sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256"; | ||||||
| # Prefer modern host key algorithms | ||||||
| HostKeyAlgorithms = "ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256"; | ||||||
| # Prefer modern public key algorithms | ||||||
| PubkeyAcceptedAlgorithms = "ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256-cert-v01@openssh.com,rsa-sha2-256"; | ||||||
| }; | ||||||
| }; | ||||||
| "localhost" = { | ||||||
|
|
@@ -30,6 +38,7 @@ | |||||
| }; | ||||||
| "github.com" = { | ||||||
| serverAliveInterval = 0; | ||||||
| identityFile = "~/.ssh/id_ed25519_github"; | ||||||
|
||||||
| identityFile = "~/.ssh/id_ed25519_github"; | |
| identityFile = [ "~/.ssh/id_ed25519_github" "~/.ssh/id_ed25519" ]; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,6 +40,10 @@ in | |||||
| lib.makeBinPath [ | ||||||
| pkgs.git | ||||||
| pkgs.bash | ||||||
| pkgs.coreutils | ||||||
| pkgs.gnumake | ||||||
| pkgs.curl | ||||||
| pkgs.nix | ||||||
|
Comment on lines
+43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, examine the complete default.nix file
cat -n home-manager/services/dotfiles-updater/default.nixRepository: shunkakinoki/dotfiles Length of output: 1930 🏁 Script executed: # List files in the dotfiles-updater directory
ls -la home-manager/services/dotfiles-updater/
# Check for update.sh and install.sh
find home-manager/services/dotfiles-updater -name "*.sh" -type fRepository: shunkakinoki/dotfiles Length of output: 344 🏁 Script executed: # Read the update.sh script
cat -n home-manager/services/dotfiles-updater/update.sh
# Also search for install.sh in case it exists elsewhere
find . -name "install.sh" -type f 2>/dev/null | head -20Repository: shunkakinoki/dotfiles Length of output: 549 🏁 Script executed: # Read the install.sh script
cat -n ./install.sh | head -100Repository: shunkakinoki/dotfiles Length of output: 4493 🏁 Script executed: # Search for 'make' usage in install.sh
grep -n "make" ./install.sh
# Get the full length of install.sh to understand its scope
wc -l ./install.shRepository: shunkakinoki/dotfiles Length of output: 649 🏁 Script executed: # Let's also check if there are any other dependencies in install.sh
grep -nE "(command -v|which|apt-get|brew install)" ./install.sh | head -30Repository: shunkakinoki/dotfiles Length of output: 580 Darwin launchd service requires equivalent dependencies for consistency and reliability. The update.sh script runs install.sh on both Darwin and Linux, and install.sh depends on curl (for Nix installation), gnumake, and nix. While the Darwin PATH includes fallback directories ( 🤖 Prompt for AI Agents
Comment on lines
+43
to
+46
|
||||||
| ] | ||||||
| }"; | ||||||
|
||||||
| }"; | |
| }:/usr/local/bin:/usr/bin"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,20 @@ | ||
| let | ||
| # Galactica's SSH public key | ||
| galactica = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKze2jlpV7SyTKA2ezqbumpCiDn+5Sj4z5SxrqfzesX shunkakinoki@gmail.com"; | ||
| # Kyber's SSH public key | ||
| kyber = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0IZtP3KSzY6GVSZ+R+VQYYfu3sEOVaQGDblQxAtwNM ubuntu@kyber"; | ||
| # All machines that can decrypt shared secrets | ||
| allMachines = [ galactica kyber ]; | ||
| in | ||
|
Comment on lines
+1
to
+11
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You've done a great job refactoring this file to use a Example {
galactica = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKze2jlpV7SyTKA2ezqbumpCiDn+5Sj4z5SxrqfzesX shunkakinoki@gmail.com";
kyber = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0IZtP3KSzY6GVSZ+R+VQYYfu3sEOVaQGDblQxAtwNM ubuntu@kyber";
}Then you could use it like this: let
publicKeys = import ../public-keys.nix;
allMachines = with publicKeys; [ galactica kyber ];
in
{
# ...
} |
||
| { | ||
| # Shared SSH key for GitHub authentication (accessible on all machines) | ||
| "keys/id_ed25519.age" = { | ||
| file = ./keys/id_ed25519.age; | ||
| publicKeys = [ | ||
| "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKze2jlpV7SyTKA2ezqbumpCiDn+5Sj4z5SxrqfzesX shunkakinoki@gmail.com" | ||
| ]; | ||
| publicKeys = allMachines; | ||
| }; | ||
| # GPG key (galactica only) | ||
| "keys/gpg.age" = { | ||
| file = ./keys/gpg.age; | ||
| publicKeys = [ | ||
| "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKze2jlpV7SyTKA2ezqbumpCiDn+5Sj4z5SxrqfzesX shunkakinoki@gmail.com" | ||
| ]; | ||
| publicKeys = [ galactica ]; | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||
| #!/usr/bin/env bash | ||||||||||||||
| # Remotely rekey galactica secrets to include kyber's public key | ||||||||||||||
| # This script should be run from kyber to trigger the rekey on galactica | ||||||||||||||
|
|
||||||||||||||
| set -e | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For better script safety and to be consistent with other scripts in this repository (like
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| echo "🔑 Rekeying galactica secrets to include kyber..." | ||||||||||||||
| echo "" | ||||||||||||||
| echo "This will:" | ||||||||||||||
| echo "1. Connect to galactica via Tailscale SSH" | ||||||||||||||
| echo "2. Run the rekey command to re-encrypt secrets with both keys" | ||||||||||||||
| echo "3. Commit and push the changes" | ||||||||||||||
| echo "" | ||||||||||||||
|
|
||||||||||||||
| # Try Tailscale SSH first | ||||||||||||||
| if tailscale ssh shunkakinoki@galactica "cd ~/dotfiles && make rekey-galactica" 2>/dev/null; then | ||||||||||||||
| echo "✅ Rekey completed via Tailscale SSH" | ||||||||||||||
| else | ||||||||||||||
| echo "❌ Tailscale SSH failed. Please run this manually on galactica:" | ||||||||||||||
| echo "" | ||||||||||||||
| echo " cd ~/dotfiles" | ||||||||||||||
| echo " git pull" | ||||||||||||||
| echo " make rekey-galactica" | ||||||||||||||
| echo " git add named-hosts/galactica/keys/" | ||||||||||||||
| echo " git commit -m 'chore(agenix): rekey secrets for kyber access'" | ||||||||||||||
| echo " git push" | ||||||||||||||
| echo "" | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| # Pull the changes | ||||||||||||||
| echo "" | ||||||||||||||
| echo "📥 Pulling re-encrypted secrets..." | ||||||||||||||
|
||||||||||||||
| echo "📥 Pulling re-encrypted secrets..." | |
| echo "📥 Pulling re-encrypted secrets..." | |
| if [ ! -d ~/dotfiles ]; then | |
| echo "❌ Error: ~/dotfiles directory does not exist. Please ensure it exists before running this script." | |
| exit 1 | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,21 +2,24 @@ | |||||||||||||
| # To add a new secret: | ||||||||||||||
| # 1. Add the secret definition here | ||||||||||||||
| # 2. Run: make encrypt-key-kyber KEY_FILE=/path/to/secret | ||||||||||||||
| let | ||||||||||||||
| # Galactica's SSH public key | ||||||||||||||
| galactica = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKze2jlpV7SyTKA2ezqbumpCiDn+5Sj4z5SxrqfzesX shunkakinoki@gmail.com"; | ||||||||||||||
| # Kyber's SSH public key | ||||||||||||||
| kyber = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO0IZtP3KSzY6GVSZ+R+VQYYfu3sEOVaQGDblQxAtwNM ubuntu@kyber"; | ||||||||||||||
| # All machines that can decrypt shared secrets | ||||||||||||||
| allMachines = [ galactica kyber ]; | ||||||||||||||
| in | ||||||||||||||
| { | ||||||||||||||
| # Tailscale auth key - generate from https://login.tailscale.com/admin/settings/keys | ||||||||||||||
| # "keys/tailscale-auth.age" = { | ||||||||||||||
| # file = ./keys/tailscale-auth.age; | ||||||||||||||
| # publicKeys = [ | ||||||||||||||
| # # Kyber's SSH public key (run: ssh ubuntu@kyber "cat ~/.ssh/id_ed25519.pub") | ||||||||||||||
| # "ssh-ed25519 AAAA..." | ||||||||||||||
| # ]; | ||||||||||||||
| # }; | ||||||||||||||
| "keys/tailscale-auth.age" = { | ||||||||||||||
| file = ./keys/tailscale-auth.age; | ||||||||||||||
| publicKeys = [ kyber ]; | ||||||||||||||
| }; | ||||||||||||||
|
|
||||||||||||||
| # SSH key sync (your local key encrypted for kyber) | ||||||||||||||
| # "keys/id_ed25519.age" = { | ||||||||||||||
| # file = ./keys/id_ed25519.age; | ||||||||||||||
| # publicKeys = [ | ||||||||||||||
| # "ssh-ed25519 AAAA..." | ||||||||||||||
| # ]; | ||||||||||||||
| # }; | ||||||||||||||
| # Shared SSH key for GitHub authentication (synced from galactica) | ||||||||||||||
| "keys/id_ed25519.age" = { | ||||||||||||||
| file = ../galactica/keys/id_ed25519.age; | ||||||||||||||
|
Comment on lines
+23
to
+25
|
||||||||||||||
| # Shared SSH key for GitHub authentication (synced from galactica) | |
| "keys/id_ed25519.age" = { | |
| file = ../galactica/keys/id_ed25519.age; | |
| # Shared SSH key for GitHub authentication (shared between galactica and kyber; both hosts must have access to this file) | |
| "keys/id_ed25519.age" = { | |
| file = ../shared/keys/id_ed25519.age; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: shunkakinoki/dotfiles
Length of output: 1635
🏁 Script executed:
rg "KexAlgorithms|HostKeyAlgorithms|PubkeyAcceptedAlgorithms" home-manager/programs/ssh/default.nix -A 2 -B 2Repository: shunkakinoki/dotfiles
Length of output: 809
🏁 Script executed:
Repository: shunkakinoki/dotfiles
Length of output: 960
🌐 Web query:
OpenSSH 8.5 sntrup761x25519-sha512 post-quantum key exchange algorithm introduction date💡 Result:
The sntrup761x25519-sha512 hybrid post‑quantum KEX was added in OpenSSH 8.5, which was released on March 3, 2021. [1][2]
Sources:
[1] OpenSSH release notes — OpenSSH 8.5/8.5p1 (2021-03-03). [2] Announcement / changelog noting sntrup761x25519-sha512 in OpenSSH 8.5.
Line length violations in SSH configuration.
The security improvements with sntrup761x25519-sha512@openssh.com and modern algorithms are sound, however lines 26, 28, and 30 exceed the 100-character limit (147, 171, and 178 characters respectively), violating the Nix formatting guideline. These algorithm lists should be split across multiple lines or refactored to meet the formatting requirement.
🤖 Prompt for AI Agents