How to get FHS shell.nix to work with nix-shell --run

I want to make a FHSUserEnv as a systemd service, so it is always running. In order to do this, there has to be a command to run it non-interactively, which would seem simple. But although I have a shell.nix that sets everything up, and a shell script that can be run within that shell after nix-shell is run, I cannot get the invocation of nix-shell to run the shell script.

The shell.nix:

{ pkgs ? import <nixpkgs> {} }:

let myoraclejdk8 = pkgs.oraclejdk8.override { pluginSupport = true; } ; in 


(pkgs.buildFHSUserEnv {
  name = "simple-x11-env";
  targetPkgs = pkgs: (with pkgs;
    [ udev
      alsaLib
      pciutils
      which
      xdg_utils
      wget
      iana-etc
      procps
      psmisc
      python2
      myoraclejdk8
      xvfb_run
    ]) ++ (with pkgs.xorg;
    [ libX11
      libXcursor
      libXrandr
      libXext
      libXtst
      libXi
      libXrender
    ]);
  multiPkgs = pkgs: (with pkgs;
    [ udev
      alsaLib
    ]);
  #runScript = "bash";
  #runScript = "./webswingInner.sh ";
}).env

As you can see, runScript does nothing. The result is always the same. nix-shell drops you into a shell, and runs nothing. Even with nix-shell --run ./webswingInner.sh or nix-shell --command ./webswingInner.sh.

Hello Henry!

Did you ever figure it out? I just ran into this same issue…