services.nix (2817B) download
1{ pkgs ? import <nixpkgs> { } }:
2
3with pkgs; [
4 {
5 name = "9wm";
6 enable = false;
7 setup = "";
8 run = writeScript "9wm-run" ''
9 #!/bin/sh
10
11 SVDIR=.. sv check xserver > /dev/null || exit 1
12
13 cd $HOMEs
14 exec 9wm
15 '';
16 }
17 {
18 name = "blueman-applet";
19 enable = true;
20 setup = "";
21 run = writeScript "blueman-applet-run" ''
22 #!/bin/sh
23
24 exec blueman-applet
25 '';
26 }
27 {
28 name = "dbus-session";
29 enable = true;
30 setup = "";
31 run = writeScript "dbus-session-run" ''
32 #!/bin/sh
33
34 exec dbus-daemon --nofork --session
35 '';
36 }
37 {
38 name = "dwm";
39 enable = true;
40 setup = "";
41 run = writeScript "dwm-run" ''
42 #!/bin/sh
43
44 cd $HOME
45 exec dwm
46 '';
47 }
48 {
49 name = "nm-applet";
50 enable = true;
51 setup = "";
52 run = writeScript "nm-applet-run" ''
53 #!/bin/sh
54
55 exec nm-applet
56 '';
57 }
58 {
59 name = "pa-applet";
60 enable = true;
61 setup = "";
62 run = writeScript "pa-applet-run" ''
63 #!/bin/sh
64
65 exec pa-applet
66 '';
67 }
68 {
69 name = "slstatus";
70 enable = true;
71 setup = "";
72 run = writeScript "slstatus-run" ''
73 #!/bin/sh
74
75 FIFO=/tmp/slstatus.fifo
76
77 [ -p $FIFO ] || rm -f $FIFO
78 mkfifo $FIFO
79
80 exec slstatus -p $FIFO
81 '';
82 }
83 {
84 name = "slstatus-xbps";
85 enable = true;
86 setup = "";
87 run = writeScript "slstatus-xbps-run" ''
88 #!/bin/bash
89
90 OUTPUT=/tmp/xbps-updates.txt
91
92 while true; do
93 updates=$(xbps-install -Mun | wc -l)
94
95 if [ $updates -ne 0 ]; then
96 echo $updates > $OUTPUT
97 else
98 echo up-to-date > $OUTPUT
99 fi
100 sleep 120
101 done
102 '';
103 }
104 {
105 name = "stw-service";
106 enable = true;
107 setup = "";
108 run = writeScript "stw-service-run" ''
109 #!/bin/sh
110
111 exec stw -p 1 -b '#ebdbb2' -f '#3c3836' -F 'Source Code Pro:size=9' -B 10 -y 20 sh -c 'echo -- services -- ; psv /var/service/* ~/.xservice/* 2> /dev/null | sort -k2,2 -k1,1'
112 '';
113 }
114 {
115 name = "stw-xbps";
116 enable = true;
117 setup = "";
118 run = writeScript "stw-xbps-run" ''
119 #!/bin/sh
120
121 exec stw -b '#ebdbb2' -f '#3c3836' -F 'Source Code Pro:size=9' -B 10 -p 120 -y 100% -Y -100% sh -c 'echo -- updates -- && xbps-install -Mun | cut -d" " -f1'
122 '';
123 }
124 {
125 name = "tiramisu";
126 enable = true;
127 setup = "";
128 run = writeScript "tiramisu-run" ''
129 #!/bin/sh
130
131 SVDIR=.. sv check slstatus > /dev/null || exit 1
132
133 exec tiramisu -o '\\x04#source\\x05#summary: #body\\n' | xargs -i printf '%b' '{}' > /tmp/slstatus.fifo
134 '';
135 }
136 {
137 name = "xfce-polkit";
138 enable = true;
139 setup = "";
140 run = writeScript "xfce-polkit-run" ''
141 #!/bin/sh
142
143 exec /usr/libexec/xfce-polkit
144 '';
145 }
146]