nix-config/home/wallets/umount_wallets.nix

21 lines
664 B
Nix
Raw Normal View History

2022-01-18 09:32:55 +01:00
{ dev_name, config, pkgs, ... }:
let
home = "${config.home.homeDirectory}";
shell = "${pkgs.dash}/bin/dash";
cryptsetup = "${pkgs.cryptsetup}/bin/cryptsetup";
sudo = "/run/wrappers/bin/sudo";
umount = "/run/wrappers/bin/umount";
in
pkgs.writeScriptBin "umount_wallets" ''
#!${shell}
${sudo} ${umount} --recursive "${home}/.walletwasabi"
${sudo} ${umount} --recursive "${home}/.local/share/Bisq"
${sudo} ${umount} --recursive "${home}/.bitmonero"
${sudo} ${umount} --recursive "${home}/monero-storage"
${sudo} ${umount} --recursive "${home}/.electrumfair"
${sudo} ${cryptsetup} close ${dev_name}
''