diff --git a/nixos/hosts/shodan/auto-mount.nix b/nixos/hosts/shodan/auto-mount.nix index b323eb3..42aa919 100644 --- a/nixos/hosts/shodan/auto-mount.nix +++ b/nixos/hosts/shodan/auto-mount.nix @@ -19,10 +19,8 @@ ''; systemd.services."external-drive-mount@" = { - path = with pkgs; [jq coreutils udisks bash util-linux toybox auto-mount]; + path = with pkgs; [jq coreutils udisks bash util-linux toybox auto-mount steam]; enable = true; - scriptArgs = "%i"; - serviceConfig = { ExecStart = "${pkgs.auto-mount}/bin/auto-mount add %i"; ExecStop = "${pkgs.auto-mount}/bin/auto-mount remove %i"; diff --git a/pkgs/auto-mount/default.nix b/pkgs/auto-mount/default.nix index c3b8347..00c461d 100644 --- a/pkgs/auto-mount/default.nix +++ b/pkgs/auto-mount/default.nix @@ -1,6 +1,7 @@ { lib, stdenv, + steam-fsh, jq, coreutils, udisks, @@ -14,7 +15,7 @@ writeShellApplication name = "auto-mount"; - runtimeInputs = [jq coreutils udisks util-linux toybox]; + runtimeInputs = [jq coreutils udisks util-linux toybox steam]; text = '' set -euo pipefail @@ -73,7 +74,7 @@ writeShellApplication if pgrep -x "steam" > /dev/null; then # TODO use -ifrunning and check return value - if there was a steam process and it returns -1, the message wasn't sent # need to retry until either steam process is gone or -ifrunning returns 0, or timeout i guess - systemd-run -M 1000@ --user --collect --wait sh -c "./.steam/root/ubuntu12_32/steam steam://''${command}/''${encoded@Q}" + systemd-run -M 1000@ --user --collect --wait sh -c "${pkgs.steam}/bin/steam steam://''${command}/''${encoded@Q}" echo "Sent URL to steam: steam://''${command}/''${arg} (steam://''${command}/''${encoded})" else echo "Could not send steam URL steam://''${command}/''${arg} (steam://''${command}/''${encoded}) -- steam not running"