diff --git a/configurations/mail.nix b/configurations/mail.nix index 04181ac5..34b71659 100644 --- a/configurations/mail.nix +++ b/configurations/mail.nix @@ -1,13 +1,7 @@ { pkgs, lib, ... }: let - passwordScript = pkgs.writeScript "get_mail_password" '' - #!${pkgs.bash}/bin/bash - - ${pkgs.pass}/bin/pass show "$@" | head -n1 | tr -d "\n" - ''; - notifyScript = name: pkgs.writeScript "notify_${name}_mail" '' - #!${pkgs.bash}/bin/bash - + passwordScript = pkgs.writeShellScript "get_mail_password" ''${pkgs.pass}/bin/pass show "$@" | head -n1 | tr -d "\n"''; + notifyScript = name: pkgs.writeShellScript "notify_${name}_mail" '' unseen_count=$(${pkgs.mblaze}/bin/mlist -N ~/mail/*/INBOX | wc -l) if [ "$unseen_count" = "1" ] diff --git a/configurations/ssh.nix b/configurations/ssh.nix index f7aee9b3..f5c717c8 100644 --- a/configurations/ssh.nix +++ b/configurations/ssh.nix @@ -13,9 +13,7 @@ name = "openssh"; paths = [ ( - self.writeScriptBin "ssh" '' - #!${self.zsh}/bin/zsh - + self.writeShellScriptBin "ssh" '' export TERM=xterm-256color ${super.openssh}/bin/ssh $@ '' diff --git a/configurations/sway/color-picker.nix b/configurations/sway/color-picker.nix index ff279ad4..004befdf 100644 --- a/configurations/sway/color-picker.nix +++ b/configurations/sway/color-picker.nix @@ -1,8 +1,6 @@ { pkgs }: -pkgs.writeScriptBin "color_picker" '' - #!${pkgs.zsh}/bin/zsh - +pkgs.writeShellScriptBin "color_picker" '' color=$(${pkgs.grim}/bin/grim -t png -g "$(${pkgs.slurp}/bin/slurp -p)" - | ${pkgs.imagemagick}/bin/convert png:- -unique-colors txt:- | grep -o '#[A-F0-9]\+') ${pkgs.sway}/bin/swaymsg exec -- "echo -n '$color' | ${pkgs.wl-clipboard}/bin/wl-copy --foreground" diff --git a/configurations/sway/screenshot.nix b/configurations/sway/screenshot.nix index 238f27f5..1acc1d2a 100644 --- a/configurations/sway/screenshot.nix +++ b/configurations/sway/screenshot.nix @@ -1,8 +1,6 @@ { pkgs }: -pkgs.writeScriptBin "screenshot" '' - #!${pkgs.zsh}/bin/zsh - +pkgs.writeShellScriptBin "screenshot" '' while getopts ":rd" opt do case "''${opt}" in diff --git a/configurations/sway/status-configuration.nix b/configurations/sway/status-configuration.nix index eb22d551..4e5774ea 100644 --- a/configurations/sway/status-configuration.nix +++ b/configurations/sway/status-configuration.nix @@ -1,8 +1,6 @@ { pkgs, ... }: let - mic-status = pkgs.writeScript "mic-status" '' - #!${pkgs.zsh}/bin/zsh - + mic-status = pkgs.writeShellScript "mic-status" '' if [ "$(${pkgs.pulseaudio}/bin/pactl list sources | grep -o 'Mute: yes')" = "Mute: yes" ] then echo -e '\uf131' @@ -10,9 +8,7 @@ let echo -e '\uf130' fi ''; - mail-status = pkgs.writeScript "mail-status" '' - #!${pkgs.zsh}/bin/zsh - + mail-status = pkgs.writeShellScript "mail-status" '' mails=$(${pkgs.mblaze}/bin/mlist -N ~/mail/*/INBOX | wc -l) if [ "$mails" -gt 0 ] then diff --git a/shells/accentor-android.nix b/shells/accentor-android.nix index 8d0c9e24..fc204814 100644 --- a/shells/accentor-android.nix +++ b/shells/accentor-android.nix @@ -35,15 +35,11 @@ let runScript = "bash -c '''''${run}'''"; }).env ''; - gradle-run-script = pkgs.writeScriptBin "gradle" '' - #!${pkgs.bash}/bin/bash - + gradle-run-script = pkgs.writeShellScriptBin "gradle" '' REPO_ROOT="$(git rev-parse --show-toplevel)" nix-shell --argstr run "\"$REPO_ROOT/gradlew $@\"" "${gradle-fhs-nix}" ''; - sign-release = pkgs.writeScriptBin "sign-release" '' - #!${pkgs.bash}/bin/bash - + sign-release = pkgs.writeShellScriptBin "sign-release" '' BUILD_TOOLS_PATH="${composed.androidsdk}/libexec/android-sdk/build-tools/${buildToolsVersion}" REPO_ROOT="$(git rev-parse --show-toplevel)" APK_DIR="$REPO_ROOT/app/build/outputs/apk/release" diff --git a/shells/accentor-api.nix b/shells/accentor-api.nix index 98f2619c..5d7aea49 100644 --- a/shells/accentor-api.nix +++ b/shells/accentor-api.nix @@ -9,9 +9,7 @@ pkgs.mkShell { taglib zlib ( - pkgs.writeScriptBin "start-db" '' - #!/${pkgs.bash}/bin/bash - + pkgs.writeShellScriptBin "start-db" '' trap "systemd-run --user --no-block docker stop accentor-db" 0 docker run -d --name accentor-db -p 5432:5432 --rm -v accentor-db-data:/var/lib/postgresql/data -e POSTGRES_PASSWORD=accentor postgres:latest diff --git a/shells/dodona.nix b/shells/dodona.nix index fa04a107..0c525c05 100644 --- a/shells/dodona.nix +++ b/shells/dodona.nix @@ -10,9 +10,7 @@ pkgs.mkShell { yarn zlib ( - pkgs.writeScriptBin "start-dockers" '' - #!${bash}/bin/bash - + pkgs.writeShellScriptBin "start-dockers" '' trap "systemd-run --user --no-block docker stop dodona-db dodona-cache" 0 docker run -d --name dodona-db -p 3306:3306 --rm -v dodona-db-data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=dodona mariadb:latest diff --git a/shells/javafx.nix b/shells/javafx.nix index 9bfd652c..e8ab02e1 100644 --- a/shells/javafx.nix +++ b/shells/javafx.nix @@ -5,9 +5,7 @@ in pkgs.mkShell { buildInputs = with pkgs; [ ( - pkgs.writeScriptBin "java" '' - #!${pkgs.zsh}/bin/zsh - + pkgs.writeShellScriptBin "java" '' old_path="$(patchelf --print-rpath ${jdk11}/bin/java)" LD_LIBRARY_PATH="$old_path:${extraRpath}" ${jdk11}/bin/java $@ ''