From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Othacehe Subject: Defining user services in Guix. Date: Sat, 22 Apr 2017 18:50:27 +0200 Message-ID: <87o9vowfn0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d1yF9-00051n-T1 for guix-devel@gnu.org; Sat, 22 Apr 2017 12:50:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d1yF6-0007Os-QZ for guix-devel@gnu.org; Sat, 22 Apr 2017 12:50:43 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:33812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d1yF6-0007Ol-Ja for guix-devel@gnu.org; Sat, 22 Apr 2017 12:50:40 -0400 Received: by mail-wr0-x22c.google.com with SMTP id z109so69791354wrb.1 for ; Sat, 22 Apr 2017 09:50:40 -0700 (PDT) Received: from cervin (85-169-37-239.rev.numericable.fr. [85.169.37.239]) by smtp.gmail.com with ESMTPSA id 92sm15847736wra.18.2017.04.22.09.50.38 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Apr 2017 09:50:38 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org Hi Guix, I just a wrote a small service for redshift¹. Redshift is a program adjusting color temperature of the screen according to surroundings. This program needs to communicate to X, so DISPLAY and XAUTHORITY must be set correctly. The only way I found to make my service work is something very hacky: --8<---------------cut here---------------start------------->8--- (start #~(make-forkexec-constructor #$redshift-command #:user "mathieu" #:group "users" #:environment-variables '("DISPLAY=:0" "XAUTHORITY=/home/mathieu/.Xauthority"))) --8<---------------cut here---------------end--------------->8--- Is there a better way to define this kind of "user" service in Guix ? Thanks, Mathieu ¹: http://jonls.dk/redshift/