summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2025-01-07 08:59:37 +0300
committerVika <vika@fireburn.ru>2025-01-07 08:59:37 +0300
commitd3f5f5f5de77d152b0e34bd3e6d1c8a33aca7231 (patch)
treebad6ae94b5e8df44e6322ca6c301e92761481215
parent052e47883150e4b10e1a9cc7217f6ae1985864c4 (diff)
downloadxdg-desktop-portal-systemd-d3f5f5f5de77d152b0e34bd3e6d1c8a33aca7231.tar.zst
Add supplementary files to the package
-rw-r--r--default.nix9
-rw-r--r--xdg-desktop-portal-systemd.desktop6
-rw-r--r--xdg-desktop-portal-systemd.service7
-rw-r--r--xyz.vikanezrimaya.fdo.portal.Systemd.service4
4 files changed, 26 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index a5650c9..81d4916 100644
--- a/default.nix
+++ b/default.nix
@@ -19,6 +19,15 @@ let
 in crane.buildPackage (args' // {
   postInstall = ''
     install -Dm755 ${./xdg-desktop-portal-systemd.portal} $out/share/xdg-desktop-portal/portals/xdg-desktop-portal-systemd.portal
+
+    mkdir -p $out/share/systemd/user/
+    substituteAll ${./xdg-desktop-portal-systemd.service} $out/share/systemd/user/xdg-desktop-portal-systemd.service
+
+    mkdir -p $out/share/dbus-1/services/
+    substituteAll ${./xyz.vikanezrimaya.fdo.portal.Systemd.service} $out/share/dbus-1/services/xyz.vikanezrimaya.fdo.portal.Systemd.service
+
+    mkdir -p $out/share/applications
+    substituteAll ${./xdg-desktop-portal-systemd.desktop} $out/share/applications/xdg-desktop-portal-systemd.desktop
   '';
   passthru = {
     clippy = crane.cargoClippy (args' // {
diff --git a/xdg-desktop-portal-systemd.desktop b/xdg-desktop-portal-systemd.desktop
new file mode 100644
index 0000000..0cc4925
--- /dev/null
+++ b/xdg-desktop-portal-systemd.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Type=Application
+Name=Portal
+Icon=applications-system-symbolic
+Exec=@out@/bin/xdg-desktop-portal-systemd
+NoDisplay=true
\ No newline at end of file
diff --git a/xdg-desktop-portal-systemd.service b/xdg-desktop-portal-systemd.service
new file mode 100644
index 0000000..79852d8
--- /dev/null
+++ b/xdg-desktop-portal-systemd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Portal service (idle inhibit via systemd-logind)
+
+[Service]
+Type=dbus
+BusName=xyz.vikanezrimaya.fdo.portal.Systemd
+ExecStart=@out@/bin/xdg-desktop-portal-systemd
\ No newline at end of file
diff --git a/xyz.vikanezrimaya.fdo.portal.Systemd.service b/xyz.vikanezrimaya.fdo.portal.Systemd.service
new file mode 100644
index 0000000..56cb6b3
--- /dev/null
+++ b/xyz.vikanezrimaya.fdo.portal.Systemd.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=xyz.vikanezrimaya.fdo.portal.Systemd
+Exec=@out@/bin/xdg-desktop-portal-systemd
+SystemdService=xdg-desktop-portal-systemd.service
\ No newline at end of file