@@ -7,7 +7,7 @@ let user = "dustin"; in
7
7
../../modules/darwin/secrets.nix
8
8
../../modules/darwin/home-manager.nix
9
9
../../modules/shared
10
- agenix . darwinModules . default
10
+ agenix . darwinModules . default
11
11
] ;
12
12
13
13
# Auto upgrade nix package and the daemon service.
@@ -46,30 +46,35 @@ let user = "dustin"; in
46
46
agenix . packages . "${ pkgs . system } " . default
47
47
] ++ ( import ../../modules/shared/packages.nix { inherit pkgs ; } ) ;
48
48
49
- launchd . user . agents . emacs . path = [ config . environment . systemPath ] ;
50
- launchd . user . agents . emacs . serviceConfig = {
51
- KeepAlive = true ;
52
- ProgramArguments = [
53
- "/bin/sh"
54
- "-c"
55
- "{ osascript -e 'display notification \" Attempting to start Emacs...\" with title \" Emacs Launch\" '; /bin/wait4path ${ pkgs . emacs } /bin/emacs && { ${ pkgs . emacs } /bin/emacs --fg-daemon; if [ $? -eq 0 ]; then osascript -e 'display notification \" Emacs has started.\" with title \" Emacs Launch\" '; else osascript -e 'display notification \" Failed to start Emacs.\" with title \" Emacs Launch\" ' >&2; fi; } } &> /tmp/emacs_launch.log"
56
- ] ;
57
- StandardErrorPath = "/tmp/emacs.err.log" ;
58
- StandardOutPath = "/tmp/emacs.out.log" ;
59
- } ;
49
+ launchd . user . agents = {
50
+ emacs = {
51
+ path = [ config . environment . systemPath ] ;
52
+ serviceConfig = {
53
+ KeepAlive = true ;
54
+ ProgramArguments = [
55
+ "/bin/sh"
56
+ "-c"
57
+ "{ osascript -e 'display notification \" Attempting to start Emacs...\" with title \" Emacs Launch\" '; /bin/wait4path ${ pkgs . emacs } /bin/emacs && { ${ pkgs . emacs } /bin/emacs --fg-daemon; if [ $? -eq 0 ]; then osascript -e 'display notification \" Emacs has started.\" with title \" Emacs Launch\" '; else osascript -e 'display notification \" Failed to start Emacs.\" with title \" Emacs Launch\" ' >&2; fi; } } &> /tmp/emacs_launch.log"
58
+ ] ;
59
+ StandardErrorPath = "/tmp/emacs.err.log" ;
60
+ StandardOutPath = "/tmp/emacs.out.log" ;
61
+ } ;
62
+ } ;
60
63
61
- # New launchd service to toggle natural scrolling
62
- launchd . user . agents . naturalScrollingToggle . path = [ config . environment . systemPath ] ;
63
- launchd . user . agents . naturalScrollingToggle . serviceConfig = {
64
- KeepAlive = false ;
65
- RunAtLoad = true ;
66
- ProgramArguments = [
67
- "/bin/sh"
68
- "-c"
69
- "if system_profiler SPUSBDataType | grep -i \" Mouse\" ; then defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false; else defaults write NSGlobalDomain com.apple.swipescrolldirection -bool true; fi && killall Finder"
70
- ] ;
71
- StandardErrorPath = "/tmp/natural_scrolling.err.log" ;
72
- StandardOutPath = "/tmp/natural_scrolling.out.log" ;
64
+ naturalScrollingToggle = {
65
+ path = [ config . environment . systemPath ] ;
66
+ serviceConfig = {
67
+ KeepAlive = false ;
68
+ RunAtLoad = true ;
69
+ ProgramArguments = [
70
+ "/bin/sh"
71
+ "-c"
72
+ "if system_profiler SPUSBDataType | grep -i \" Mouse\" ; then defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false; else defaults write NSGlobalDomain com.apple.swipescrolldirection -bool true; fi && killall Finder"
73
+ ] ;
74
+ StandardErrorPath = "/tmp/natural_scrolling.err.log" ;
75
+ StandardOutPath = "/tmp/natural_scrolling.out.log" ;
76
+ } ;
77
+ } ;
73
78
} ;
74
79
75
80
system = {
0 commit comments