Skip to content

Commit b037a2e

Browse files
committed
build: add systemd service
1 parent a5431dd commit b037a2e

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,9 @@ install(
157157
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps
158158
RENAME org.quickshell.svg
159159
)
160+
161+
configure_file(assets/quickshell.service.in quickshell.service)
162+
install(
163+
FILES ${CMAKE_BINARY_DIR}/quickshell.service
164+
DESTINATION lib/systemd/user
165+
)

assets/quickshell.service.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Unit]
2+
Description=QtQuick-based Desktop Shell Toolkit
3+
PartOf=graphical-session.target
4+
Requisite=graphical-session.target
5+
After=graphical-session.target
6+
7+
[Service]
8+
ExecStart=@CMAKE_INSTALL_BINDIR@/quickshell
9+
Slice=session.slice
10+
Restart=on-failure

default.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@
116116
dontUnpack = true;
117117
dontConfigure = true;
118118
dontBuild = true;
119+
dontMoveSystemdUserUnits = true;
119120

120121
installPhase = ''
121-
mkdir -p $out
122-
cp -r ${unwrapped}/* $out
122+
cp -r ${unwrapped} $out
123+
substituteInPlace $out/lib/systemd/user/quickshell.service \
124+
--replace-fail ${unwrapped} $out
123125
'';
124126

125127
passthru = {

0 commit comments

Comments
 (0)