79 lines
1.9 KiB
Makefile
Raw Normal View History

2025-04-17 12:06:57 +02:00
# List all receipes
default:
@just --list
2025-04-17 12:06:57 +02:00
# Format all files in repo
fmt:
treefmt --on-unmatched info
2025-04-17 12:06:57 +02:00
# Build a specific host but don't activate it. Host must use same system as target system
2025-04-15 23:39:10 +02:00
build HOST:
git add .
just fmt
nh os build . -H {{HOST}}
2025-04-17 12:06:57 +02:00
# Switch to new config, but don't add to bootloader
test *FLAGS:
git add .
2025-04-14 23:30:50 +02:00
just fmt
nh os test . {{FLAGS}}
# Add new configuration to bootloader, but don't activate it now
boot *FLAGS:
git add .
just fmt
nh os test . {{FLAGS}}
2025-04-17 12:06:57 +02:00
# Switch to new config and add to bootloader
switch *FLAGS:
git add .
2025-04-14 23:30:50 +02:00
just fmt
nh os switch . {{FLAGS}}
2025-04-17 12:06:57 +02:00
# Switch to new config and add to bootloader without formatting or adding to git
switch-now *FLAGS:
nh os switch . {{FLAGS}}
update-all:
nix-channel --update
nix flake update
just switch
update PKG:
nix flake update {{PKG}}
just switch
# Encrypt all files in the repo using git-crypt
lock:
git-crypt lock
# Decrypt all files in the repo using git-crypt and the user's GPG key
unlock:
git-crypt unlock ~/.config/git/crypt-key
# Connect to tailnet or sign-in if not registered
start-tailscale:
tailscale up --login-server https://vpn.martials.no
# Generate a new SSH key without passphrase
generate-ssh:
ssh-keygen -t ed25519 -a 32 -f ~/.ssh/id_ed25519 -P ""
# Generate a new age key from an existing ssh key (without passphrase)
generate-age-from-ssh:
mkdir -p ~/.config/sops/age
nix run nixpkgs#ssh-to-age -- -private-key -i ~/.ssh/id_ed25519 > ~/.config/sops/age/keys.txt
# Get a public age key from an existing age private key
get-public-age-key:
nix shell nixpkgs#age -c age-keygen -y ~/.config/sops/age/keys.txt
# Edit the SOPS secrets file
edit-secrets:
nix run nixpkgs#sops -- shared/secrets/secrets.yaml
# Hash a string using the mkpasswd command
hash PASS:
echo "{{PASS}}" | mkpasswd -s