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

@ -38,6 +38,10 @@
}; };
imports = [ imports = [
# Services
./services/nix-daemon.nix # NOTE: DO NOT REMOVE
# Modules
./modules/yabai.nix ./modules/yabai.nix
./modules/skhd.nix ./modules/skhd.nix
]; ];

@ -0,0 +1,35 @@
{ config, pkgs, scriptPath ? "/opt/nix-daemon.sh", ... }:
{
home.file."Library/LaunchAgents/org.nixos.autostart.plist" = {
text = ''
<?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>Label</key>
<string>org.nixos.autostart</string>
<key>ProgramArguments</key>
<array>
<string>${pkgs.bash}/bin/bash</string>
<string>${scriptPath}</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
</dict>
</plist>
'';
};
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;
};
}
Loading…
Cancel
Save