Nixos-rebuild does not deploy systemd unit

Following documentation such as this, I have the following systemd unit config:

# api.nix
{ ... }: {
  systemd.services.foobar = {
    enable = true;
    description = "loreum ipsum";
    wantedBy = [ "multi-user.target" ];
    after = [ "network.target" ];

    serviceConfig = {
      ExecStart = "/api";
      Type = "simple";
      Restart = "always";
      User = "skainswo";
    };
  };
}

and it is being imported in configuration.nix:

# configuration.nix
{...}: {
  imports = [
    ...
    ./api.nix
  ];
  ...
}

However, when I run nixos-rebuild:

# This is the latest nixos-23.11 commit as of 2024-04-17. Check https://status.nixos.org for updates.
NIXPKGS_COMMIT=53a2c32bc66f5ae41a28d7a9a49d321172af621e
nix run github:NixOS/nixpkgs/$NIXPKGS_COMMIT#nixos-rebuild -- switch \
  -I nixos-config="$(dirname "$0")"/../nixos/configuration.nix \
  -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$NIXPKGS_COMMIT.tar.gz \
  --target-host bitbop-proxy-arm

I get the following output:

these 4 derivations will be built:
  /nix/store/6f70ls8fkhxrhc8kib3ha303ms69gpfc-unit-foobar.service.drv
  /nix/store/5iixfnfkfmvjy396nxhwqs6xxf0pr0kr-system-units.drv
  /nix/store/qy84c0z4ls1271s7zadc351kk4z415pj-etc.drv
  /nix/store/96wq8z5z3vx8s82r1lsrapjljlxsgi07-nixos-system-bitbop-proxy-arm-23.11pre-git.drv
building '/nix/store/6f70ls8fkhxrhc8kib3ha303ms69gpfc-unit-foobar.service.drv'...
building '/nix/store/5iixfnfkfmvjy396nxhwqs6xxf0pr0kr-system-units.drv'...
building '/nix/store/qy84c0z4ls1271s7zadc351kk4z415pj-etc.drv'...
building '/nix/store/96wq8z5z3vx8s82r1lsrapjljlxsgi07-nixos-system-bitbop-proxy-arm-23.11pre-git.drv'...
copying 4 paths...
copying path '/nix/store/r2d6738y9wly2f4bq838f4msc33qdlgm-unit-foobar.service' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/rzmfkln67s1nwrayc3ivgs7mkj5d4hxq-system-units' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/znimh9xpqjayqcp3fsmwykzwlgprifwm-etc' to 'ssh://bitbop-proxy-arm'...
copying path '/nix/store/xl35byy41l4w44nn46kbxjg68mz2ls29-nixos-system-bitbop-proxy-arm-23.11pre-git' to 'ssh://bitbop-proxy-arm'...
updating GRUB 2 menu...
stopping the following units: dbus-broker.service, systemd-oomd.service, systemd-oomd.socket, systemd-sysctl.service, systemd-timesyncd.service, systemd-tmpfiles-resetup.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, systemd-vconsole-setup.service
root@b62e2017d34d:/workspaces/bitbop/cherami# 

However, I do not see this unit being deployed or enabled on the remote host:

❯ ls /etc/systemd/system/ | grep foobar
❯ sudo systemctl list-units --all | grep foobar
❯

Am I missing something? Is there something wrong with my service configuration?

I can confirm that the unit definition is built successfully and does exist in the remote machine’s nix store:

❯ cat /nix/store/r2d6738y9wly2f4bq838f4msc33qdlgm-unit-foobar.service/foobar.service
[Unit]
After=network.target
Description=loreum ipsum

[Service]
Environment="LOCALE_ARCHIVE=/nix/store/vxglqdq91ikszyq6cqgxlbfqdb89z8mp-glibc-locales-2.38-44/lib/locale/locale-archive"
Environment="PATH=/nix/store/cyf8jnmaw8fmsfii36fcvjqqi1j2i3av-coreutils-9.3/bin:/nix/store/vs8v7xv5zfhnpffzyk9gygqgp9j6yvd4-findutils-4.9.0/bin:/nix/store/aiir1sygbh2d85gq6vmwynrdsp8pww4s-gnugrep-3.11/bin:/nix/store/0m86k0ylx8x35blgqbq2bfp1hmz62fda-gnused-4.9/bin:/nix/store/80nz10h39z5z6mb639jshgwigzpr2l9j-systemd-254.10/bin:/nix/store/cyf8jnmaw8fmsfii36fcvjqqi1j2i3av-coreutils-9.3/sbin:/nix/store/vs8v7xv5zfhnpffzyk9gygqgp9j6yvd4-findutils-4.9.0/sbin:/nix/store/aiir1sygbh2d85gq6vmwynrdsp8pww4s-gnugrep-3.11/sbin:/nix/store/0m86k0ylx8x35blgqbq2bfp1hmz62fda-gnused-4.9/sbin:/nix/store/80nz10h39z5z6mb639jshgwigzpr2l9j-systemd-254.10/sbin"
Environment="TZDIR=/nix/store/19rfdgm5achhjz6d0miq8qfi9v1kwcxf-tzdata-2024a/share/zoneinfo"
ExecStart=/api
Restart=always
Type=simple
User=skainswo