sane-wipe: port from systemd -> s6

This commit is contained in:
Colin 2024-03-26 16:57:30 +00:00
parent 5ed29ceb47
commit eadb2057d9
3 changed files with 5 additions and 4 deletions

View File

@ -254,7 +254,8 @@ in
"sane-scripts.wipe".sandbox = { "sane-scripts.wipe".sandbox = {
method = "bwrap"; method = "bwrap";
whitelistDbus = [ "user" ]; #< for `secret-tool` and `systemd --user stop <service> whitelistDbus = [ "user" ]; #< for `secret-tool`
whitelistS6 = true; #< for stopping services before wiping
extraHomePaths = [ extraHomePaths = [
# could be more specific, but at a maintenance cost. # could be more specific, but at a maintenance cost.
# TODO: needs updating, now that persisted data lives behind symlinks! # TODO: needs updating, now that persisted data lives behind symlinks!

View File

@ -201,7 +201,7 @@ let
wipe = static-nix-shell.mkBash { wipe = static-nix-shell.mkBash {
pname = "sane-wipe"; pname = "sane-wipe";
srcRoot = ./src; srcRoot = ./src;
pkgs = [ "dconf" "libsecret" "systemd" ]; pkgs = [ "dconf" "libsecret" "s6-rc" ];
}; };
}; };
in sane-bin // { in sane-bin // {

View File

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p dconf -p libsecret -p systemd #!nix-shell -i bash -p dconf -p libsecret -p s6-rc
help() { help() {
echo "usage: sane-wipe <resource>" echo "usage: sane-wipe <resource>"
@ -52,7 +52,7 @@ wipe_flare() {
} }
wipe_fractal() { wipe_fractal() {
systemctl --user stop fractal s6-rc stop fractal
# first, ensure the relevant secrets are unlocked # first, ensure the relevant secrets are unlocked
secret-tool search --all --unlock 'xdg:schema' 'org.gnome.Fractal' secret-tool search --all --unlock 'xdg:schema' 'org.gnome.Fractal'