sane-private-do: run a command with the private store unlocked; then re-lock it

This commit is contained in:
colin 2022-12-16 06:10:44 +00:00
parent a8a4b8e739
commit 42ebb9a155
3 changed files with 13 additions and 2 deletions

View File

@ -56,6 +56,7 @@ resholve.mkDerivation {
# these are used internally; probably a better fix
"sane-mount-servo"
"sane-private-lock"
"sane-private-unlock"
];
};

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# unlock the ~/private store, run some command, and then re-lock the store
set -x
external_cmd=$@
sane-private-unlock
$external_cmd
exec sane-private-lock

View File

@ -2,8 +2,7 @@
set -ex
# configure persistent, encrypted storage that is auto-mounted on login.
# this is a one-time setup and user should log out/back in after running it.
# mounts ~/private
mount=/home/colin/private
cipher="/nix/persist$mount"