fixed password update command

This commit is contained in:
Leyla Becker 2024-09-23 21:34:04 -05:00
parent bd7e575868
commit 4515bab713
3 changed files with 6 additions and 5 deletions

View file

@ -32,9 +32,10 @@
- Look into this for home assistant configuration https://nixos.wiki/wiki/Home_Assistant https://myme.no/posts/2021-11-25-nixos-home-assistant.html
## Configuration
updating passwords: `sops secrets/secrets.yaml`
set up git configuration for local development: `git config --local include.path .gitconfig`
to update passwords run: `nix shell nixpkgs#sops -c sops secrets/user-passwords.yaml` (NOTE: this depends on the SOPS_AGE_KEY_DIRECTORY environment variable being set)
# Tasks:
## Tech Debt

View file

@ -127,8 +127,8 @@
};
environment.sessionVariables = rec {
AGE_KEY_DIRECTORY = "/var/lib/sops-nix";
AGE_KEY_FILE = "${AGE_KEY_DIRECTORY}/key.txt";
SOPS_AGE_KEY_DIRECTORY = "/var/lib/sops-nix";
SOPS_AGE_KEY_FILE = "${SOPS_AGE_KEY_DIRECTORY}/key.txt";
};
sops = {

View file

@ -47,8 +47,8 @@ cleanup() {
trap cleanup EXIT
# copy key file to temp folder to copy over to target
mkdir -p $temp$AGE_KEY_DIRECTORY
cp -r $AGE_KEY_DIRECTORY/* $temp$AGE_KEY_DIRECTORY
mkdir -p $temp$SOPS_AGE_KEY_DIRECTORY
cp -r $SOPS_AGE_KEY_DIRECTORY/* $temp$SOPS_AGE_KEY_DIRECTORY
# commit number in this is because the main branch of nixos-anywhere is broken right now
nix run github:nix-community/nixos-anywhere/b3b6bfebba35d55fba485ceda588984dec74c54f -- --extra-files $temp --flake ".#$flake" ${user:-nixos}@$target