Desktop Shell Won't Launch

Hi everyone!

I’m trying to use DankMaterialShell with niri which works fine…. for my laptop. However, for some reason when use the same configuration on my desktop it won’t automatically launch DMS. It comes up with the following error in the journalctl -b logs-

May 28 22:46:38 desktop systemd[1403]: dms.service: Failed to open /home/mckahz/.dotfiles/apps/systemd/user/dms.service: No such file or directory

But in modules/programs.nix I have

  programs.dms-shell = {
    enable = true;
    systemd = {
      enable = true;
      restartIfChanged = true;
    };

    enableSystemMonitoring = true;
    # enableVPN = true;
    enableDynamicTheming = true;
    enableAudioWavelength = true;
    enableCalendarEvents = true;
    enableClipboardPaste = true;

    quickshell.package = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.quickshell;
  };

So I have no idea why it’s not being discovered.
I feel like I’ve tried everything but I don’t know why it’s not working. Any help would be massively appreciated!

Thanks!

maybe I’m wrong, but $HOME/.dotfiles does not seem likely to be a NixOS-managed path

No, but I do have

  environment.sessionVariables = {
    XDG_CONFIG_HOME = "/home/mckahz/.dotfiles/apps";
  };

in my config

Also I should mention that my desktop is Intel / Nvidia whereas my laptop is AMD / AMD.

Okay! I finally got it to work!
I don’t know why, but removing systemd = … from programs.nix and adding spawn-sh-at-startup "dms run" has fixed it. Thank god.

Hello,

I looked at your config, your dms.service is a symlink to the nix store. You should not hardcore paths from the nix store as they are unstable and will eventually become stale, you should instead let nix compute the path.

If you wanted to link dms.service from pkgs.dms-shell to /etc/foo/bar, you could do this:

environment.etc."foo/bar".source = "${pkgs.dms-shell}/lib/systemd/user/dms.service";

In your case, you put the service file in your $HOME, but NixOS doesn’t have a native way to link files in $HOME, so you would need something like home-manager or hjem.