63 lines
1.3 KiB
Makefile
Raw Normal View History

default:
@just --list
fmt:
treefmt --on-unmatched info
2025-04-15 23:39:10 +02:00
build HOST:
git add .
just fmt
nh os build . -H {{HOST}}
test *FLAGS:
git add .
2025-04-14 23:30:50 +02:00
just fmt
nh os test . {{FLAGS}}
switch *FLAGS:
git add .
2025-04-14 23:30:50 +02:00
just fmt
nh os switch . {{FLAGS}}
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 age key from an existing ssh key (without passphrase)
@generate-age-from-ssh:
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