fix nix daemon autostart

master
Elias Almqvist 4 months ago
parent 884b700e7f
commit 172a6124be
No known key found for this signature in database
GPG Key ID: E31A99CE3E75A158
  1. 9
      nix-darwin/services/nix-daemon.nix

@ -1,5 +1,8 @@
{ config, pkgs, scriptPath ? "/opt/nix-daemon.sh", ... }: { config, pkgs, ... }:
let
fullScriptPath = "/opt/nix-daemon.sh";
in
{ {
home.file."Library/LaunchAgents/org.nixos.autostart.plist" = { home.file."Library/LaunchAgents/org.nixos.autostart.plist" = {
text = '' text = ''
@ -12,7 +15,7 @@
<key>ProgramArguments</key> <key>ProgramArguments</key>
<array> <array>
<string>${pkgs.bash}/bin/bash</string> <string>${pkgs.bash}/bin/bash</string>
<string>${scriptPath}</string> <string>${fullScriptPath}</string>
</array> </array>
<key>RunAtLoad</key> <key>RunAtLoad</key>
<true/> <true/>
@ -23,7 +26,7 @@
''; '';
}; };
home.file."${scriptPath}" = { home.file."${fullScriptPath}" = {
text = '' text = ''
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then 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' . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'

Loading…
Cancel
Save