summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/arbtt.nix
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2017-05-25 19:33:13 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2017-05-29 15:05:28 +0200
commit1e95e114e5eefdb0f792f9f7a620c9472e6d7da3 (patch)
tree67b8c3f40258a027d211ebd75dd685ee3e7d3841 /nixos/modules/services/monitoring/arbtt.nix
parent13f2f8673b184599e7a65df422c968730554820f (diff)
downloadnixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar.gz
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar.bz2
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar.lz
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar.xz
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.tar.zst
nixpkgs-1e95e114e5eefdb0f792f9f7a620c9472e6d7da3.zip
nixos/xsession: use graphical systemd user target
While systemd suggests using the pre-defined graphical-session user
target, I found that this interface is difficult to use. Additionally,
no other major distribution, even in their unstable versions, currently
use this mechanism.

The window or desktop manager is supposed to run in a systemd user service
which activates graphical-session.target and the user services that are
binding to this target. The issue is that we can't elegantly pass the
xsession environment to the window manager session, in particular
whereas the PassEnvironment option does work for DISPLAY, it for some
mysterious reason won't for PATH.

This commit implements a new graphical user target that works just like
default.target. Services which should be run in a graphical session just
need to declare wantedBy graphical.target. The graphical target will be
activated in the xsession before executing the window or display manager.

Fixes #17858.
Diffstat (limited to 'nixos/modules/services/monitoring/arbtt.nix')
-rw-r--r--nixos/modules/services/monitoring/arbtt.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/services/monitoring/arbtt.nix b/nixos/modules/services/monitoring/arbtt.nix
index a8d5e3b7fa0..b41a3c7b501 100644
--- a/nixos/modules/services/monitoring/arbtt.nix
+++ b/nixos/modules/services/monitoring/arbtt.nix
@@ -48,7 +48,8 @@ in {
   config = mkIf cfg.enable {
     systemd.user.services.arbtt = {
       description = "arbtt statistics capture service";
-      wantedBy = [ "default.target" ];
+      wantedBy = [ "graphical-session.target" ];
+      partOf = [ "graphical-session.target" ];
 
       serviceConfig = {
         Type = "simple";