Add current hummelberg-new state
This commit is contained in:
parent
dd204c8ba6
commit
51f5e7eab9
30 changed files with 1486 additions and 0 deletions
52
defaults/user-configuration/fhauser/applications/scripts.nix
Normal file
52
defaults/user-configuration/fhauser/applications/scripts.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
passbemenu = pkgs.writeScriptBin "passbemenu" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
shopt -s nullglob globstar
|
||||
|
||||
typeit=0
|
||||
if [[ $1 == "--type" ]]; then
|
||||
typeit=1
|
||||
shift
|
||||
fi
|
||||
|
||||
export BEMENU_BACKEND=wayland
|
||||
|
||||
prefix=''${PASSWORD_STORE_DIR-~/.password-store}
|
||||
password_files=( "$prefix"/**/*.gpg )
|
||||
password_files=( "''${password_files[@]#"$prefix"/}" )
|
||||
password_files=( "''${password_files[@]%.gpg}" )
|
||||
|
||||
password=$(printf '%s\n' "''${password_files[@]}" | \
|
||||
${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Pass: ' "$@")
|
||||
|
||||
[[ -n $password ]] || exit
|
||||
|
||||
${pkgs.pass-wayland}/bin/pass show -c "$password" 2>/dev/null
|
||||
'';
|
||||
threema-vpn = pkgs.writeScriptBin "threema-vpn" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
set -eo pipefail
|
||||
|
||||
SERVICE=openvpn-threema.service
|
||||
|
||||
if [[ "$1" == "restart" ]]; then
|
||||
ACTION=restart
|
||||
elif [[ "$1" == "start" ]]; then
|
||||
ACTION=start
|
||||
elif [[ "$1" == "stop" ]]; then
|
||||
ACTION=stop
|
||||
elif [[ "$1" == "status" ]]; then
|
||||
ACTION=status
|
||||
elif [[ "$1" == "tail" ]]; then
|
||||
sudo journalctl -f -u $SERVICE
|
||||
exit 0
|
||||
else
|
||||
echo "Usage: vpn (start|stop|restart|status|tail)"
|
||||
exit 254
|
||||
fi
|
||||
|
||||
sudo systemctl $ACTION $SERVICE
|
||||
'';
|
||||
in { home-manager.users.fhauser.home.packages = [ passbemenu threema-vpn ]; }
|
Loading…
Add table
Add a link
Reference in a new issue