Justfile: add uuid-to-device-name recipe

This commit is contained in:
steveej 2020-12-16 10:53:51 +01:00
parent e6d60ab345
commit 53929393a6
2 changed files with 7 additions and 0 deletions

View file

@ -315,3 +315,9 @@ switch-gpg-card:
# refresh the gpg agent # refresh the gpg agent
gpg-connect-agent "scd serialno" "learn --force" /bye gpg-connect-agent "scd serialno" "learn --force" /bye
gpg --card-status gpg --card-status
# Connect to `remote` UUID, and turn it into a short name
uuid-to-device-name remote:
#!/usr/bin/env bash
set -e -o pipefail
ssh {{remote}} 'nix run nixpkgs.dmidecode -c dmidecode -s system-uuid' | xxhsum --quiet -H1 | awk '{print $1}'

View file

@ -26,6 +26,7 @@ stdenv.mkDerivation {
nmap nmap
sysstat sysstat
lshw lshw
xxHash
]; ];
# Set Environment Variables # Set Environment Variables