{ config, pkgs, scriptPath ? "/opt/nix-daemon.sh", ... }: { home.file."Library/LaunchAgents/org.nixos.autostart.plist" = { text = '' Label org.nixos.autostart ProgramArguments ${pkgs.bash}/bin/bash ${scriptPath} RunAtLoad KeepAlive ''; }; home.file."${scriptPath}" = { text = '' if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' fi ''; executable = true; }; }