{ config, pkgs, ... }: let fullScriptPath = "/opt/nix-daemon.sh"; in { home.file."Library/LaunchAgents/org.nixos.autostart.plist" = { text = '' Label org.nixos.autostart ProgramArguments ${pkgs.bash}/bin/bash ${fullScriptPath} RunAtLoad KeepAlive ''; }; home.file."${fullScriptPath}" = { 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; }; }