LnL7 / nix-darwin

nix modules for darwin
MIT License
3.19k stars 457 forks source link

Uninstalling fails to delete /Library/LaunchDaemons/org.nixos.nix-daemon.plist, and I'm not sure why it'd try #910

Closed grahamc closed 1 week ago

grahamc commented 8 months ago

In a fresh install of Nix 2.20.5 with the Determinate Nix Installer after just installing nix-darwin, I uninstalled nix-darwin with darwin-uninstall.

It emitted a strange line about deleting nix-daemon.plist:

grahamc@Grahams-MacBook-Pro> darwin-uninstaller

Uninstalling nix-darwin, this will:

    - remove /Applications/Nix Apps symlink
    - cleanup static /etc files
    - disable and remove all launchd services managed by nix-darwin
    - restore daemon service from nix installer (only when this is a multi-user install)

Proceed? [y/n] y
user defaults...
setting up user launchd services...
setting up /Applications/Nix Apps...
setting up pam...
applying patches...
setting up /etc...
system defaults...
setting up launchd services...
removing service org.nixos.activate-system
removing service org.nixos.nix-daemon
configuring networking...
setting nvram variables...
rm: cannot remove '/Library/LaunchDaemons/org.nixos.nix-daemon.plist': No such file or directory

-- is this intentional? I'd expect it to not try to delete this at all. Even stranger, that file definitely does exist:

grahamc@Grahams-MacBook-Pro> cat /Library/LaunchDaemons/org.nixos.nix-daemon.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>EnvironmentVariables</key>
    <dict>
      <key>OBJC_DISABLE_INITIALIZE_FORK_SAFETY</key>
      <string>YES</string>
    </dict>
    <key>Label</key>
    <string>org.nixos.nix-daemon</string>
    <key>KeepAlive</key>
    <true/>
    <key>RunAtLoad</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
      <string>/bin/sh</string>
      <string>-c</string>
      <string>/bin/wait4path /nix/var/nix/profiles/default/bin/nix-daemon &amp;&amp; exec /nix/var/nix/profiles/default/bin/nix-daemon</string>
    </array>
    <key>StandardErrorPath</key>
    <string>/var/log/nix-daemon.log</string>
    <key>StandardOutPath</key>
    <string>/dev/null</string>
    <key>SoftResourceLimits</key>
    <dict>
      <key>NumberOfFiles</key>
      <integer>1048576</integer>
    </dict>
  </dict>
</plist>