From patchwork Mon Sep 6 15:26:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32678 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 198A927BBE3; Mon, 6 Sep 2021 16:28:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C861D27BBE1 for ; Mon, 6 Sep 2021 16:28:35 +0100 (BST) Received: from localhost ([::1]:49054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXy-0002CN-U3 for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGWV-00084Z-IJ for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42686) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGWU-0006Bm-9o for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGWU-0006l9-5t for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 1/8] gnu: crates-io: Add rust-enquote-1 1.0.3. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094201825960 (code B ref 49969); Mon, 06 Sep 2021 15:27:02 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:26:58 +0000 Received: from localhost ([127.0.0.1]:54224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWQ-0006kd-Et for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:58 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:35658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWM-0006jq-Q9 for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:55 -0400 Received: by mail-wr1-f46.google.com with SMTP id i6so10400335wrv.2 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=nGRF6KAbypoktvlGEItN5gIlD/JiWED8K+c6mSAChh8=; b=RgRMqFtyM2nXCxEWllaLV/f/ZorUElNZY8n2//WMMLp3ArLP6eTyqlVfodrBg6GfPr rsMP7yQLh4E/luZEltNbGcc7JcIplYFQdox60vg9nD8ryPWxseXTjh25IueWFI0qQXio 61G1XU2tYwfK3vMqmIXZ6hWZtVCM2AIxyohk2NZgDe82Vomd7bIwEzSIhYIiw68NkI31 PdMm96rKAzzj5i9s3xuGKaBl5OBCYNGT/c6AnsJxztU/8by0E7KqjrBT5itIAU3DGZyU 1fR2t5sTRRHRzJSyi9bKQc7N0A56daRa7f0u6Tkhnap9LyAtSEuAVocY21tHSqKj5O8R bdaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nGRF6KAbypoktvlGEItN5gIlD/JiWED8K+c6mSAChh8=; b=fjukUBfkV8O4up1RqwRa8+BI5c+3EV8qbD+RPEgHdsEHD47tzc3bdZGUv95GutYoDg EXj8QwHHSpBCYbsMKIRiWhiI2zFdqptSIJCuOA56lasEmATkqtotN9oxKufMHBKD3Taq EAQdCBxN1eo1kOHXzEoK/Su+TcZEycGQ6KuYzKuaYy/GwNvJIs3LXP0ibMadxKcO14xM qADzMkqp+9gRlnOWEWaDAr0Iz3CroKM3FiExtoXLvBNO+/NLPIX/yGw+rDQ4WeM70Fsx bfZjL1XsmBj+yd2ElVwh3n8fsEXdmzDuSglNJk8MxCh9879xLZaB66UwcpgLyG+Spj7e AxOA== X-Gm-Message-State: AOAM532vaewMgPjWc1XJi1d0gaj6NQLEFmfLIeUxHjMhN377BZ0PjTVU rAGMv5U0gBe98Ng4kZ7/ksmZEc1FLF1wyoFa X-Google-Smtp-Source: ABdhPJyth0fTJEP9v0C2opdvyGfKLB8Rdlj3AKdzxGMASaH71Q4ZZGT6TpBy3fOndM7PQc/rbpkmSg== X-Received: by 2002:a05:6000:188d:: with SMTP id a13mr13837868wri.99.1630942008553; Mon, 06 Sep 2021 08:26:48 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.47 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:48 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:34 +0300 Message-Id: <20210906152641.11020-2-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/crates-io.scm (rust-enquote-1): New variable --- gnu/packages/crates-io.scm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index aee7a6f756..7c915df487 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2021 Antero Mejr ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Vinicius Monego +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -57383,3 +57384,24 @@ variant of this library is available separately as @code{im}.") (description "Generate Rust register maps (`struct`s) from SVD files") (license (list license:expat license:asl2.0)))) + +(define-public rust-enquote-1 + (package + (name "rust-enquote") + (version "1.0.3") + (home-page "https://github.com/reujab/enquote") + (source + (origin + (method url-fetch) + (uri (crate-uri "enquote" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0vm687r2wwgc3d3l2iqhag9wgkql6k93sdvjxvmfkdpksajpij1f")))) + (build-system cargo-build-system) + (synopsis + "A Rust library quotes, unquotes, and unescapes strings") + (description + "A Rust library quotes, unquotes, and unescapes strings") + (license license:unlicense))) From patchwork Mon Sep 6 15:26:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32672 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E162927BBE3; Mon, 6 Sep 2021 16:27:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A1D0F27BBE1 for ; Mon, 6 Sep 2021 16:27:20 +0100 (BST) Received: from localhost ([::1]:45334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGWl-00085C-HS for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:27:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGWV-00084Y-IC for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42688) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGWU-0006Br-NT for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGWU-0006lG-Ix for guix-patches@gnu.org; Mon, 06 Sep 2021 11:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 2/8] gnu: crates-io: Add rust-pam-sys 0.5.6. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094201925966 (code B ref 49969); Mon, 06 Sep 2021 15:27:02 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:26:59 +0000 Received: from localhost ([127.0.0.1]:54226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWQ-0006kf-Mg for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:58 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:34574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWN-0006jr-GS for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:55 -0400 Received: by mail-wm1-f50.google.com with SMTP id v20-20020a1cf714000000b002e71f4d2026so135052wmh.1 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ITcOEM+wtNs9cmAKCTGmBFvPFkXnzJdOpIyV8Z++toU=; b=aNklrpHYaI4HWNjvNgRST2EFHkTH/Sp/nRem/gqTSNjTxfh11RTd4cYECVAxTi4Y8D yJMKHTZLUJeqxshawiF6ZymxKZDQ6yIeu1qEX3UQC4DQ+6iabTP0pW/8AECuw0Wu/E3w WvjWGUJy70WBqnGRcT4uiA2ZiGYqi76gSApSfsu4wZ4IB70k7MNZr6PaurXUTDX8qIY5 AQ5GIOu6btGekA21bj+XdSTMXfJUqE4RZku+dVQsNBssJYY9PZoDO+5K+yLJy18cpZ2J ZxJ8yDUHsyVK+/6SSmJISHew5TtB2bhTUWEQdoui8rzpFHdJP1Lb8jzXAZz4hnFmKvPT ytmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ITcOEM+wtNs9cmAKCTGmBFvPFkXnzJdOpIyV8Z++toU=; b=RZNexOi9OCb0u4tLAXfhSxE/J3T1AssJggn1qydQjzGhGoRZcwvT9iSc3pbLyudfNI wuI09T+W/AjO+dO3EGhRSE2QGwekDbgbCve1Ly8nG8zQGjHr5WSugamfdHlwoZ0mRAAE fp4mg7d3Z0M7dEQY6Xd0n8YZFqHg+SUsf41IZZWgQPlASCGijoRSSnlzt8vHkEvdZbMF 2hJ4sr+vB+Gcb8M88B4pV3t8HEQWeupcXK1l04TOq8etoXRiFchL4CTsK/RNdZL8aNPP Kc7b321F7ZG+2FhR8H7NAQhEGNyYV4ZAORQy9beV3YLNIW+6l8T5HV2MLV64+2Kl97nY nxhw== X-Gm-Message-State: AOAM531ryo8UY6zJSUX2JZi/u4OvkO6izP1mytyWv+zLmIjNMV04hE06 zZh+X8POQKAjAuEW4xv0n0BQJHXDmEHDEdod X-Google-Smtp-Source: ABdhPJy+Z5c4Z92iqfgmk6s7AWdwtuvEFvRImNZJEQJqEpqAXdy5DhvkLJmUx2hNgfL0YvgIyckARA== X-Received: by 2002:a05:600c:3b26:: with SMTP id m38mr11735689wms.155.1630942009582; Mon, 06 Sep 2021 08:26:49 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.48 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:49 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:35 +0300 Message-Id: <20210906152641.11020-3-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/crates-io.scm (rust-pam-sys-0): New variable --- gnu/packages/crates-io.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 7c915df487..6f962dec9e 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -55,6 +55,7 @@ #:use-module (gnu packages glib) #:use-module (gnu packages image) #:use-module (gnu packages jemalloc) + #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages multiprecision) #:use-module (gnu packages nettle) @@ -57405,3 +57406,29 @@ variant of this library is available separately as @code{im}.") (description "A Rust library quotes, unquotes, and unescapes strings") (license license:unlicense))) + +(define-public rust-pam-sys-0 + (package + (name "rust-pam-sys") + (version "0.5.6") + (home-page "https://github.com/1wilkens/pam-sys") + (source + (origin + (method url-fetch) + (uri (crate-uri "pam-sys" version)) + (file-name + (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0d14501d5vybjnzxfjf96321xa5wa36x1xvf02h02zq938qmhj6d")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-libc" ,rust-libc-0.2)))) + (native-inputs + `(("linux-pam" ,linux-pam))) + (synopsis + "Rust FFI wrappers for the Linux Pluggable Authentication Modules (PAM)") + (description + "Rust FFI wrappers for the Linux Pluggable Authentication Modules (PAM)") + (license (list license:expat license:asl2.0)))) From patchwork Mon Sep 6 15:26:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32673 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 78A9227BBE4; Mon, 6 Sep 2021 16:28:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4FBB827BBE3 for ; Mon, 6 Sep 2021 16:28:15 +0100 (BST) Received: from localhost ([::1]:47258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXe-0000zA-Cu for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXS-0000vp-9U for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXS-0006zL-29 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXR-0006nl-Uw for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 3/8] gnu: admin: Add greetd 0.8.0. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094202326017 (code B ref 49969); Mon, 06 Sep 2021 15:28:01 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:03 +0000 Received: from localhost ([127.0.0.1]:54229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWR-0006ks-Vi for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:03 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:38600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWO-0006jt-QQ for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:57 -0400 Received: by mail-wr1-f47.google.com with SMTP id u16so10382224wrn.5 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+kPyJClvY2gokRyY+vFO+UTd8Le0znSYq8SQWJwy+lM=; b=VGuVAB6Dynhxt303SzSF/VcscTZR1QRKauTCKLe9qIZzIDYFBd44egxUdVd0jsRlHN h5jYpNWRcrKBSV+mtnZ5uYfBREr66rjihoCP+2g2kj3BOAZmyaoFVJaDoBPSceYP/4g8 gLot+h1KvM2TiIfVA89pUIRRxNnr3lf67x++yBeGxDq8RiZEK37mozXqJaOHKD5/FDBB EJrD6SCsVzgQSQXFvczosp0/75frorbgrI/Zr0EKZUSRxecVkrYetpKhoCIy4ulRcrz3 NTIWYh+EC1fuBWsMWsclmKhSVazn9EkHRCRDiobWG31gRpyCB4/6AZbQA3kfCvJXAwL6 g7zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+kPyJClvY2gokRyY+vFO+UTd8Le0znSYq8SQWJwy+lM=; b=rpLvA0VeQ+fE5WmBz73Jv1uLP+hO3SjU6l3PoaTRethJd1Y9mMfDf0YNhxVWoWOOVq eKU8gPJEhN5fBs95shpEeoBiH3zkgjX9USZADtYn+cujXYtLxmbbeufVVR7zqtdN0arG 7F/6IP/4GwXGBydF8RgzxaofE3HPujGxd8az9dfzYyoGRUzpJUuMGVO0MYAB/RYCl1zO Le0Vof5PTrY8E8atWuHbarCUKaunudAY1ZeWB4O1cDZs3lLycRBE3+Cd8UjKm9/OMhsY PmFhinxSOiBRTmb0Zg2e9Ewzkweax8WxoE37JZuEPRqwB4WnbvDNCj1vNrf6bp8MT9V7 yozw== X-Gm-Message-State: AOAM5316pqXLuihylpV3Kdyv3UIm38G3q4fDndEjCyJzM6oukMCP0v37 nxyGpGeiWo7Q6JB3YWQky18dVfZdCT5qqp4+ X-Google-Smtp-Source: ABdhPJxSS7xONKSKQXj6u8aF4RrTqL0ITwLoyto4/cak0KG2SFCJ0EyYg14P63v05wv7uZSltTlwTw== X-Received: by 2002:adf:9f4a:: with SMTP id f10mr13921981wrg.384.1630942010706; Mon, 06 Sep 2021 08:26:50 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.49 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:50 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:36 +0300 Message-Id: <20210906152641.11020-4-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (greetd): New variable --- gnu/packages/admin.scm | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index db820b28c1..de59c793cc 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -44,6 +44,7 @@ ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2021 Maxim Cournoyer ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -61,6 +62,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages admin) + #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) #:use-module (guix build-system emacs) #:use-module (guix build-system glib-or-gtk) @@ -87,6 +89,7 @@ #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) #:use-module (gnu packages cross-base) #:use-module (gnu packages crypto) #:use-module (gnu packages cryptsetup) @@ -4799,3 +4802,79 @@ setup, maintenance, supervision, or any long-running processes.") (description "Utility to convert @code{lsof} output to a graph showing FIFO and UNIX interprocess communication.") (license license:bsd-2)))) + +(define-public greetd + (package + (name "greetd") + (version "0.8.0") + (home-page "https://git.sr.ht/~kennylevinsen/greetd") + (source (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0x5c3jkw09kvj2grcxm899y2n6ws8p990cyp9cs0fy6lm4fzlh6v")))) + (build-system cargo-build-system) + (arguments + `(#:cargo-inputs + (("rust-nix" ,rust-nix-0.19) + ("rust-pam-sys" ,rust-pam-sys-0) + ("rust-rpassword" ,rust-rpassword-5) + ("rust-users" ,rust-users-0.11) + ("rust-serde" ,rust-serde-1) + ("rust-serde-json" ,rust-serde-json-1) + ("rust-libc" ,rust-libc-0.2) + ("rust-tokio" ,rust-tokio-1) + ("rust-getopts" ,rust-getopts-0.2) + ("rust-thiserror" ,rust-thiserror-1) + ("rust-async-trait" ,rust-async-trait-0.1) + ("rust-enquote" ,rust-enquote-1)) + #:phases + (modify-phases %standard-phases + (delete 'package) + (add-after 'build 'build-man-pages + (lambda* (#:key inputs #:allow-other-keys) + (define (scdoc-cmd doc lvl) + (system (string-append "scdoc < " + doc "-" lvl ".scd > " + doc "." lvl))) + (with-directory-excursion "man" + (scdoc-cmd "greetd" "1") + (scdoc-cmd "greetd" "5") + (scdoc-cmd "greetd-ipc" "7") + (scdoc-cmd "agreety" "1")))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (sbin (string-append out "/sbin")) + (share (string-append out "/share")) + (man (string-append share "/man")) + (man1 (string-append man "/man1")) + (man5 (string-append man "/man5")) + (man7 (string-append man "/man7")) + (release "target/release") + (greetd-bin (string-append release "/greetd")) + (agreety-bin (string-append release "/agreety"))) + (install-file greetd-bin sbin) + (install-file agreety-bin bin) + (with-directory-excursion "man" + (install-file "greetd.1" man1) + (install-file "greetd.5" man5) + (install-file "greetd-ipc.7" man7) + (install-file "agreety.1" man1)))))))) + (native-inputs + `(("linux-pam" ,linux-pam) + ("scdoc" ,scdoc))) + (synopsis "minimal and flexible login manager daemon") + (description + "greetd is a minimal and flexible login manager daemon +that makes no assumptions about what you want to launch. + +If you can run it from your shell in a TTY, greetd can start it. + +If it can be taught to speak a simple JSON-based IPC protocol, +then it can be a greeter.") + (license license:gpl3+))) From patchwork Mon Sep 6 15:26:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32674 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CCEAD27BBE3; Mon, 6 Sep 2021 16:28:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D362327BBE1 for ; Mon, 6 Sep 2021 16:28:15 +0100 (BST) Received: from localhost ([::1]:47290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXe-00010g-UB for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXS-0000wg-Ml for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXS-0006zT-F5 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXS-0006ns-Br for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 4/8] gnu: admin: Add greetd-pam-mount. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094202426032 (code B ref 49969); Mon, 06 Sep 2021 15:28:02 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:04 +0000 Received: from localhost ([127.0.0.1]:54237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWV-0006la-Cv for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:04 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:44586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWP-0006jv-Qq for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:26:58 -0400 Received: by mail-wr1-f46.google.com with SMTP id d6so9741635wrc.11 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=axcYfzOaSjpWu/K2adWVmBxQl2mHcn/sXEeyRImVzeI=; b=JGgTs1VXzDGKA0Dc/X2+5IThJeUtlV6Gq8pxA/mNjzkOuwtHbsK86lCjcSn2zklkBU csi9YLBfjt1STAn/KKKHPSSs0Gs0OSUeUi0F56o+6DqUmOVMu78yDfCQf+STJZ+ltdkE /1MbRGR8E8B5LWiNCg1BN1fl0RJ83U+2xO/2czZk+gx0blPGeKz53/PYr9JFqkmzkYTl XIbD56oIb0klCKmB0T37LrPSsc4WH+wQAI5Byxt9RHdCadL74946x/Kx5ZOYH0x3W6FX LdaSmgE5iYw4Fje26PH56MT7MDDNPbxzNePsLUkn80jP9JNk/Ajth9wW9KsuSh7biL28 Q66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=axcYfzOaSjpWu/K2adWVmBxQl2mHcn/sXEeyRImVzeI=; b=jzx8GX5uNA6bt1GO04d+IQHyOcFFNPy1TDBXtA9uSYJZCO2ryaaG08SWuaESpEUnpl rSIenonxlN+1C7HDvsbgEy2AOSKk07u4fQk10H73oXcmJxsWV0DIAE4xD8QCbCoE6Pt3 4XElnH1i2wNNAxB6kwGd3EFSdpnLmJ+aP8HxwqHay7+rgDe6agv4gi0zzmjpQe0E5wSU vHCNQI4TsYTKEWneqnC9Y+0NSbLQEVjF6YXuudB4JCqMk0FW9kux9H7HbkCSc8pB2J7H 6Wc/wuMfqqJEM12o2d1HrjSjo5DMSWl7466LNczGvjIBqzPtYUtfLnPZlOO7SCs7Z+uS aRVg== X-Gm-Message-State: AOAM5318iznYNAvEgL0Jsmlk4M15bo3LkoFR11tnrl565785x+JS7rCK gldaqIynIoh6loDNSueYBiOGX7L62qSNl72K X-Google-Smtp-Source: ABdhPJwHYMqr/F/ug5ivBxlDybk67zcTdPSIgmy3TpR1lmno4CYVNI+H5Q6jcby/vNIVDjfDA4Lz+w== X-Received: by 2002:a5d:53c1:: with SMTP id a1mr13853993wrw.209.1630942011873; Mon, 06 Sep 2021 08:26:51 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.50 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:51 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:37 +0300 Message-Id: <20210906152641.11020-5-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (greetd-pam-mount): New variable --- gnu/packages/admin.scm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index de59c793cc..90cc1d62da 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -4878,3 +4878,35 @@ If you can run it from your shell in a TTY, greetd can start it. If it can be taught to speak a simple JSON-based IPC protocol, then it can be a greeter.") (license license:gpl3+))) + +(define-public greetd-pam-mount + (package + (inherit pam-mount) + (name "greetd-pam-mount") + (arguments + (substitute-keyword-arguments (package-arguments pam-mount) + ((#:configure-flags flags ''()) + `(cons* "--with-rundir=/run/greetd" ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'patch-config-file-name + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "src/pam_mount.c" + ((".*define CONFIGFILE .*$") + "#define CONFIGFILE \"/etc/security/greetd_pam_mount.conf.xml\"\n") + (("pam_mount_config") "greetd_pam_mount_config") + (("pam_mount_system_authtok") "greetd_pam_mount_system_authtok")))))))) + (synopsis "pam-mount specifically compiled for use with greetd") + (description + "Pam-mount is a PAM module that can mount volumes when a user logs in. +It supports mounting local filesystems of any kind the normal mount utility +supports. It can also mount encrypted LUKS volumes using the password +supplied by the user when logging in. + +This package inherits pam-mount in the way that it is compiled specifically +for use with greetd daemon. It uses different configuration location and +name space for storing data in PAM. + +greetd-pam-mount is used in configuration of greetd to provide +auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that it will not +interfere with default pam-mount configuration."))) From patchwork Mon Sep 6 15:26:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32675 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AE13227BBE3; Mon, 6 Sep 2021 16:28:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id BE84F27BBE1 for ; Mon, 6 Sep 2021 16:28:24 +0100 (BST) Received: from localhost ([::1]:47950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXn-0001Sw-Q6 for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXT-0000yS-IO for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXT-00070l-A3 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXT-0006o7-6g for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 5/8] gnu: base: Add greetd-service-type. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094202726055 (code B ref 49969); Mon, 06 Sep 2021 15:28:03 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:07 +0000 Received: from localhost ([127.0.0.1]:54241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWY-0006mA-Pj for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:07 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:39634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWR-0006jz-N9 for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:04 -0400 Received: by mail-wm1-f45.google.com with SMTP id u26-20020a05600c441a00b002f66b2d8603so5274696wmn.4 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=IalnNXP0H/t+CIyYtKSGdpVxvxILqEneh6CQnel+TjY=; b=n0X1Ycwj3l6yfSZ/A7yEdwLpA26rF27wwHqH5B6yY5adVN8E19EkgTj3d1E4eR0ubX ls0229l+KKC/73tR87s9TySW9Eclq6sfuP39wPIZG2FPHzJzFBT7EvuffSPvYQl3EUFs vzqVJa5WfO8g1ucrGTC3OuOOE94bo2U1vxrkBip8gM8JYLlo9mDz2SvzzrPgCsR9oDaH samge9gTtYFDANCoJKxxuHdFtJv7hN/A4C4NuHfLX1WxZBmiY6Sg7Fs9+rFgSyLqq5B5 s1VOq9Bt9LQUAs1YCFyxfGIhpuZF/AJ2xd5/Ln5QnRHw6k3D6Idfm0T/mYb+Jdq68fA1 fECQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IalnNXP0H/t+CIyYtKSGdpVxvxILqEneh6CQnel+TjY=; b=WzHM2gMV+u68mGqz8E/0cDl1mDrbXyPIFt8Nlg7gvU/NF+Xt0F2HsKOvVgMf4fldu2 5e2I8erPzY6an/w+bzewrkyggzdDM+PD2df/mPK8tiGmjnNNwKJLriTd+EXs6ND0ZgUO y6ghJgXzBVcb69xnrrPreomlXsr2eT1auQz1XfXvSMtKpWTOT1Qv3xNf8aRxGkKCtLBg LcbG+1Ba5HVlH8gXwbBKc/F6dWC/tM4MTOH6SceopcVcUXF5md3TOsv8LBBAu73vPCme 8P/WgOh8LnQcAS5z3grwhCWnSokrPS5Kp0t6cAs8EUUn1zJlgI/nLTRv/EPeAJ7Bg52F OnLQ== X-Gm-Message-State: AOAM5306ASMVtLirHmmd5vBh/bSSwAprc2nqLtZicknty98p8sv/K1fD K1KaLVsPT8YR0GA14RP/sE5mnuTmuzm8MvL9 X-Google-Smtp-Source: ABdhPJyPxyAlyeMlj4bD5n9ym48AovHd9MDxx30aUwagTV4gjrhOi+G1I9/xNR2S78lF+2j/zz/teA== X-Received: by 2002:a05:600c:230a:: with SMTP id 10mr11943153wmo.79.1630942013193; Mon, 06 Sep 2021 08:26:53 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.52 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:52 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:38 +0300 Message-Id: <20210906152641.11020-6-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Currently, only agreety greeter and its configuration is provided. * gnu/services/base.scm (greetd-service-type): New variable * gnu/services/base.scm (pam-limits-service-type): Should be aware of greetd PAM service * gnu/services/pam-mount.scm (pam-mount-pam-service): Should be aware of greetd PAM service. --- doc/guix.texi | 133 ++++++++++++++++++++++ gnu/services/base.scm | 218 ++++++++++++++++++++++++++++++++++++- gnu/services/pam-mount.scm | 2 +- 3 files changed, 351 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 36a0c7f5ec..79bf291ec4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -96,6 +96,7 @@ Copyright @copyright{} 2021 Domagoj Stolfa@* Copyright @copyright{} 2021 Hui Lu@* Copyright @copyright{} 2021 pukkamustard@* Copyright @copyright{} 2021 Alice Brenon@* +Copyright @copyright{} 2021 muradm@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -15953,6 +15954,138 @@ about the Pluggable Authentication Module (PAM) limits, refer to the @samp{pam_limits} man page from the @code{linux-pam} package. @end deffn +@defvr {Scheme Variable} greetd-service-type +@uref{https://git.sr.ht/~kennylevinsen/greetd, @code{greetd}} is a minimal and +flexible login manager daemon, that makes no assumptions about what you +want to launch. + +If you can run it from your shell in a TTY, greetd can start it. If it +can be taught to speak a simple JSON-based IPC protocol, then it can be +a geeter. + +@code{greetd-service-type} provides necessary infrastructure for logging +in users, including: + +@itemize @bullet +@item +@code{greetd} PAM service + +@item +Special variation of @code{pam-mount} to mount @code{XDG_RUNTIME_DIR} +@end itemize + +Here is example of switching from @code{mingetty-service-type} to +@code{greetd-service-type}, and how different terminals could be: + +@lisp + (append + (modify-services %base-services + ;; greetd-service-type provides "greetd" PAM service + (delete login-service-type) + ;; and can be used in place of mingetty-service-type + (delete mingetty-service-type)) + (list + (service greetd-service-type + (greetd-configuration + (terminals + (list + ;; we can make any terminal active by default + (greetd-terminal-configuration (terminal-vt "1") (terminal-switch #t)) + ;; we can make environment without XDG_RUNTIME_DIR set + ;; even provide our own environment variables + (greetd-terminal-configuration + (terminal-vt "2") + (default-session-command + (greetd-agreety-session + (extra-env '(("MY_VAR" . "1"))) + (xdg-env? #f)))) + ;; we can use different shell instead of default bash + (greetd-terminal-configuration + (terminal-vt "3") + (default-session-command + (greetd-agreety-session (command (file-append zsh "/bin/zsh"))))) + ;; we can use any other executable command as greeter + (greetd-terminal-configuration + (terminal-vt "4") + (default-session-command (program-file "my-noop-greeter" #~(exit)))) + (greetd-terminal-configuration (terminal-vt "5")) + (greetd-terminal-configuration (terminal-vt "6")))))) + ;; mingetty-service-type can be used in parallel + ;; if needed to do so, do not (delete login-service-type) + ;; as illustrated above + #| (service mingetty-service-type (mingetty-configuration (tty "tty8"))) |#)) +@end lisp +@end defvr + +@deftp {Data Type} greetd-configuration +Configuration record for the @code{greetd-service-type}. +@table @asis + +@item @code{motd} +A file-like object containing the ``message of the day''. + +@item @code{allow-empty-passwords?} (default: @code{#t}) +Allow empty passwords by default so that first-time users can log in when +the 'root' account has just been created. + +@item @code{terminals} (default: @code{'()}) +List of @code{greetd-terminal-configuration} per terminal for which +@code{greetd} should be started. +@end table +@end deftp + +@deftp {Data Type} greetd-terminal-configuration +Configuration record for per terminal greetd daemon service. + +@table @asis +@item @code{greetd} (default: @code{greetd}) +The greetd package to use. + +@item @code{config-file-name} +Configuration file name to use for greetd daemon. Generally, autogenerated +derivation based on @code{terminal-vt} value. + +@item @code{terminal-vt} (default: @samp{"7"}) +The VT to run on. Use of a specific VT with appropriate conflict avoidance +is recommended. + +@item @code{terminal-switch} (default: @code{#f}) +Make this terminal active on start of @code{greetd}. + +@item @code{default-session-user} (default: @samp{"greeter"}) +The user to use for running the greeter. + +@item @code{default-session-command} (default: @code{(greetd-agreety-session)}) +Can be either instance of @code{greetd-agreety-session} configuration or +@code{gexp->script} like object to use as greeter. + +@end table +@end deftp + +@deftp {Data Type} greetd-agreety-session +Configuration record for the agreety greetd greeter. + +@table @asis +@item @code{agreety} (default: @code{greetd}) +The package with @command{/bin/agreety} command. + +@item @code{command} (default: @code{(file-append bash "/bin/bash")}) +Command to be started by @command{/bin/agreety} on successful login. + +@item @code{command-args} (default: @code{'("-l")}) +Command arguments to pass to command. + +@item @code{extra-env} (default: @code{'()}) +Extra environment variables to set on login. + +@item @code{xdg-env?} (default: @code{#t}) +If true @code{XDG_RUNTIME_DIR} and @code{XDG_SESSION_TYPE} will be set +before starting command. One should note that, @code{extra-env} variables +are set right after mentioned variables, so that they can be overriden. + +@end table +@end deftp + @node Scheduled Job Execution @subsection Scheduled Job Execution diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 50865055fe..fe2c4d6fe5 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2021 qblade ;;; Copyright © 2021 Hui Lu ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -186,6 +187,11 @@ references-file + greetd-service-type + greetd-configuration + greetd-terminal-configuration + greetd-agreety-session + %base-services)) ;;; Commentary: @@ -1401,7 +1407,7 @@ information on the configuration file syntax." (module "pam_limits.so") (arguments '("conf=/etc/security/limits.conf"))))) (if (member (pam-service-name pam) - '("login" "su" "slim" "gdm-password" "sddm")) + '("login" "greetd" "su" "slim" "gdm-password" "sddm")) (pam-service (inherit pam) (session (cons pam-limits @@ -2462,6 +2468,216 @@ to handle." (requirement requirement) (name-servers name-servers))))) + +;;; +;;; greetd-service-type -- minimal and flexible login manager daemon +;;; + +(define-record-type* + greetd-agreety-session make-greetd-agreety-session + greetd-agreety-session? + (agreety greetd-agreety (default greetd)) + (command greetd-agreety-command (default (file-append bash "/bin/bash"))) + (command-args greetd-agreety-command-args (default '("-l"))) + (extra-env greetd-agreety-extra-env (default '())) + (xdg-env? greetd-agreety-xdg-env? (default #t))) + +(define greetd-agreety-tty-session-command + (match-lambda + (($ _ command args extra-env) + (program-file + "agreety-tty-session-command" + #~(begin + (use-modules (ice-9 match)) + (for-each (match-lambda ((var . val) (setenv var val))) + (quote (#$@extra-env))) + (apply execl #$command #$command (list #$@args))))))) + +(define greetd-agreety-tty-xdg-session-command + (match-lambda + (($ _ command args extra-env) + (program-file + "agreety-tty-xdg-session-command" + #~(begin + (use-modules (ice-9 match)) + (let* + ((username (getenv "USER")) + (useruid (passwd:uid (getpwuid username))) + (useruid (number->string useruid))) + (setenv "XDG_SESSION_TYPE" "tty") + (setenv "XDG_RUNTIME_DIR" (string-append "/run/user/" useruid))) + (for-each (match-lambda ((var . val) (setenv var val))) + (quote (#$@extra-env))) + (apply execl #$command #$command (list #$@args))))))) + +(define (make-greetd-agreety-session-command config command) + (let ((agreety (file-append (greetd-agreety config) "/bin/agreety"))) + (program-file + "agreety-command" + #~(execl #$agreety #$agreety "-c" #$command)))) + +(define (make-greetd-default-session-command config-or-command) + (cond ((greetd-agreety-session? config-or-command) + (cond ((greetd-agreety-xdg-env? config-or-command) + (make-greetd-agreety-session-command + config-or-command + (greetd-agreety-tty-xdg-session-command config-or-command))) + (#t + (make-greetd-agreety-session-command + config-or-command + (greetd-agreety-tty-session-command config-or-command))))) + (#t config-or-command))) + +(define-record-type* + greetd-terminal-configuration make-greetd-terminal-configuration + greetd-terminal-configuration? + (greetd greetd-package (default greetd)) + (config-file-name greetd-config-file-name (thunked) + (default (default-config-file-name this-record))) + (terminal-vt greetd-terminal-vt (default "7")) + (terminal-switch greetd-terminal-switch (default #f)) + (default-session-user greetd-default-session-user (default "greeter")) + (default-session-command greetd-default-session-command + (default (greetd-agreety-session)) + (sanitize make-greetd-default-session-command))) + +(define (default-config-file-name config) + (string-join (list "config-" (greetd-terminal-vt config) ".toml") "")) + +(define (make-greetd-terminal-configuration-file config) + (let* + ((config-file-name (greetd-config-file-name config)) + (terminal-vt (greetd-terminal-vt config)) + (terminal-switch (greetd-terminal-switch config)) + (default-session-user (greetd-default-session-user config)) + (default-session-command (greetd-default-session-command config))) + (mixed-text-file + config-file-name + "[terminal]\n" + "vt = " terminal-vt "\n" + "switch = " (if terminal-switch "true" "false") "\n" + "[default_session]\n" + "user = " default-session-user "\n" + "command = " default-session-command "\n"))) + +(define %greetd-accounts + (list (user-account + (name "greeter") + (group "wheel") + (supplementary-groups '("users" "tty" "input" "video" "audio")) + (system? #t)))) + +(define %greetd-file-systems + (list (file-system + (device "none") + (mount-point "/run/greetd/pam_mount") + (type "tmpfs") + (check? #f) + (flags '(no-suid no-dev no-exec)) + (options "mode=0755") + (create-mount-point? #t)))) + +(define %greetd-pam-mount-rules + `((debug (@ (enable "0"))) + (volume (@ (sgrp "users") + (fstype "tmpfs") + (mountpoint "/run/user/%(USERUID)") + (options "noexec,nosuid,nodev,size=1g,mode=0700,uid=%(USERUID),gid=%(USERGID)"))) + (logout (@ (wait "0") + (hup "0") + (term "yes") + (kill "no"))) + (mkmountpoint (@ (enable "1") (remove "true"))))) + +(define-record-type* + greetd-configuration make-greetd-configuration + greetd-configuration? + (motd greetd-motd (default %default-motd)) + (allow-empty-passwords? greetd-allow-empty-passwords? (default #t)) + (terminals greetd-terminals (default '()))) + +(define (make-greetd-pam-mount-conf-file config) + (computed-file + "greetd_pam_mount.conf.xml" + #~(begin + (use-modules (sxml simple)) + (call-with-output-file #$output + (lambda (port) + (sxml->xml + '(*TOP* + (*PI* xml "version='1.0' encoding='utf-8'") + (pam_mount + #$@%greetd-pam-mount-rules + (pmvarrun + #$(file-append greetd-pam-mount + "/sbin/pmvarrun -u '%(USER)' -o '%(OPERATION)'")))) + port)))))) + +(define (greetd-etc-service config) + `(("security/greetd_pam_mount.conf.xml" + ,(make-greetd-pam-mount-conf-file config)))) + +(define (greetd-pam-service config) + (define optional-pam-mount + (pam-entry + (control "optional") + (module #~(string-append #$greetd-pam-mount "/lib/security/pam_mount.so")) + (arguments '("disable_interactive")))) + + (list + (unix-pam-service "greetd" + #:login-uid? #t + #:allow-empty-passwords? + (greetd-allow-empty-passwords? config) + #:motd + (greetd-motd config)) + (lambda (pam) + (if (member (pam-service-name pam) + '("login" "greetd" "su" "slim" "gdm-password")) + (pam-service + (inherit pam) + (auth (append (pam-service-auth pam) + (list optional-pam-mount))) + (session (append (pam-service-session pam) + (list optional-pam-mount)))) + pam)))) + +(define (greetd-shepherd-services config) + (map + (lambda (tc) + (let* + ((greetd-bin (file-append (greetd-package tc) "/sbin/greetd")) + (greetd-conf (make-greetd-terminal-configuration-file tc)) + (greetd-vt (greetd-terminal-vt tc))) + (shepherd-service + (documentation "Minimal and flexible login manager daemon") + (requirement '(user-processes host-name udev virtual-terminal)) + (provision (list (symbol-append + 'term-tty + (string->symbol (greetd-terminal-vt tc))))) + (start #~(make-forkexec-constructor + (list #$greetd-bin "-c" #$greetd-conf) + #:log-file + (string-append "/tmp/greetd." #$greetd-vt ".log"))) + (stop #~(make-kill-destructor))))) + (greetd-terminals config))) + +(define greetd-service-type + (service-type + (name 'greetd) + (description "Provides necessary infrastructure for logging into the +system including @code{greetd} PAM service, @code{pam-mount} module to +mount/unmount /run/user/ directory for user and @code{greetd} +login manager daemon.") + (extensions + (list + (service-extension account-service-type (const %greetd-accounts)) + (service-extension file-system-service-type (const %greetd-file-systems)) + (service-extension etc-service-type greetd-etc-service) + (service-extension pam-root-service-type greetd-pam-service) + (service-extension shepherd-root-service-type greetd-shepherd-services))) + (default-value (greetd-configuration)))) + (define %base-services ;; Convenience variable holding the basic services. diff --git a/gnu/services/pam-mount.scm b/gnu/services/pam-mount.scm index 98611462c2..d6c65e3760 100644 --- a/gnu/services/pam-mount.scm +++ b/gnu/services/pam-mount.scm @@ -90,7 +90,7 @@ (module #~(string-append #$pam-mount "/lib/security/pam_mount.so")))) (list (lambda (pam) (if (member (pam-service-name pam) - '("login" "su" "slim" "gdm-password")) + '("login" "greetd" "su" "slim" "gdm-password")) (pam-service (inherit pam) (auth (append (pam-service-auth pam) From patchwork Mon Sep 6 15:26:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32679 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4429727BBE3; Mon, 6 Sep 2021 16:28:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C146A27BBE1 for ; Mon, 6 Sep 2021 16:28:42 +0100 (BST) Received: from localhost ([::1]:49612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGY5-0002Zk-T9 for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXT-0000xY-86 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXS-000706-Sn for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXS-0006nz-Pt for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 6/8] gnu: admin: Add libseat 0.5.0 and move seatd. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094202526045 (code B ref 49969); Mon, 06 Sep 2021 15:28:02 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:05 +0000 Received: from localhost ([127.0.0.1]:54239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWX-0006m1-F4 for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:05 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:33790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWS-0006k1-9j for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:04 -0400 Received: by mail-wm1-f54.google.com with SMTP id 192-20020a1c04c9000000b002f7a4ab0a49so165702wme.0 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4mZtYHzSGxDT/1cWU1R9cOsdqEjO9CpUULIb7Fu5ak4=; b=03N/Puqnoio5C/1xf4l3he+QZQHQvwqSz7YiFuIQTYMfnAnjN+xIooSfv8YpJPenLe pdzMSSlj3HZ5iFW7SmF2XV3bPFkqi7ZDYbZ6so/+YksC8O4ufmePNuO9Pk1nP/MXsJBq b0fkp6ibwvrXP+iwBLJqMqpCpKYTEgxE8J6HUY6LqsgAwoMi4fnnDS+NCaGOXsmpyr5b QMYlVYeMVbawSn7h2V3SGAv8o/girwuxS0h6Y+8XDONK9x4f0fCQx+KNjix5Q1h/GAms DKjjgkYw6CBU6SP5dkWRAnmUDmes9QnvddMJLCaL6cqPgAu+nADiWgnrSTeN65IVvdFu BKww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4mZtYHzSGxDT/1cWU1R9cOsdqEjO9CpUULIb7Fu5ak4=; b=N1gIppHDHwyQi0j0E/fwSTLQ+FSIednJg9GW/LlnaBU6s3VWJ7AuPfPQ3tNkqAscYR fXS6CIUGrI8J4byP9HbfD4SJ5faTdR+444WGEpQGSa/V1WG1OlVGwh6Pdr6p1eCfvT5l Z4NkHyd2JLwccYAdAd/cPgM9aNsrjHvWUSmhom4yaXca8kG98cTXn21UebPLqtvr35cK flNfJ94q1wci7VxbCt9drVXqZwIaZTed8FqaIR0LeC/2Pn2taJlI9AkIlKUbM7pfInSb smMdi7oP8IRnxpv5ZeKFYmc9Z6Yyqbeni7rsisPh+H/S/mMNX+ibU+ayUgOoc+M7P4F8 TDiA== X-Gm-Message-State: AOAM532dfa3UgvBah1l132eWb6evZop3JibF4JeCaSkjhRoScWGEZ0ys m8dyZuzE+V+MzK74+2C9N0QBkvNbOMcsbzuW X-Google-Smtp-Source: ABdhPJye1pJuNT7q2p8054XFo85nGTRn+NUZyLot9oAFt8m8zz6BjgucjZulg8gS0yVwXWhh9IOP1w== X-Received: by 2002:a05:600c:a05:: with SMTP id z5mr11746212wmp.73.1630942014206; Mon, 06 Sep 2021 08:26:54 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.53 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:53 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:39 +0300 Message-Id: <20210906152641.11020-7-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (libseat): New variable * gnu/packages/admin.scm (seatd): New variable * gnu/packages/freedesktop.scm (seatd): Removed variable --- gnu/packages/admin.scm | 53 ++++++++++++++++++++++++++++++++++++ gnu/packages/freedesktop.scm | 30 -------------------- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 90cc1d62da..3a8efa50fe 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -98,6 +98,7 @@ #:use-module (gnu packages elf) #:use-module (gnu packages file) #:use-module (gnu packages flex) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) @@ -4803,6 +4804,58 @@ setup, maintenance, supervision, or any long-running processes.") FIFO and UNIX interprocess communication.") (license license:bsd-2)))) +(define-public libseat + (package + (name "libseat") + (version "0.5.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://git.sr.ht/~kennylevinsen/seatd") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1kglq8v4rnr3415mfaghyv2s2f8mxsy5s881gmm2908ig4n4j297")))) + (build-system meson-build-system) + (arguments + `(#:configure-flags '("-Dlibseat-logind=enabled" + "-Dserver=disabled"))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("elogind" ,elogind))) + (home-page "https://sr.ht/~kennylevinsen/seatd") + (synopsis "Seat management library") + (description + "This package provides a universal seat management library that +allows applications to use whatever seat management is available.") + (license license:expat))) + +(define-public seatd + (package + (inherit libseat) + (name "seatd") + (arguments + `(#:configure-flags '("-Dlibseat-logind=disabled" + "-Dlibseat-seatd=disabled") + #:phases + (modify-phases %standard-phases + (add-after 'install 'remove-libs + (lambda* (#:key outputs #:allow-other-keys) + (with-directory-excursion (assoc-ref outputs "out") + (for-each delete-file-recursively '("lib" "include")))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("scdoc" ,scdoc))) + (inputs '()) + (synopsis "Seat management daemon") + (description + "This package provides a minimal seat management daemon whose task is to +mediate access to shared devices, such as graphics and input, for applications +that require it.") + (license license:expat))) + (define-public greetd (package (name "greetd") diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 086707d51a..76a16454b1 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -833,36 +833,6 @@ GNOME Shell. The @command{localectl} command-line tool allows you to interact with localed. This package is extracted from the broader systemd package.") (license license:lgpl2.1+))) -(define-public seatd - (package - (name "seatd") - (version "0.5.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://git.sr.ht/~kennylevinsen/seatd") - (commit version))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1kglq8v4rnr3415mfaghyv2s2f8mxsy5s881gmm2908ig4n4j297")))) - (build-system meson-build-system) - (arguments - `(#:configure-flags '("-Dlogind=enabled"))) - (native-inputs - `(("pkg-config" ,pkg-config) - ("scdoc" ,scdoc))) - (inputs - `(("elogind" ,elogind))) - (home-page "https://sr.ht/~kennylevinsen/seatd") - (synopsis "Seat management daemon and library") - (description - "This package provides a minimal seat management daemon whose task is to -mediate access to shared devices, such as graphics and input, for applications -that require it. It also provides a universal seat management library that -allows applications to use whatever seat management is available.") - (license license:expat))) - (define-public packagekit (package (name "packagekit") From patchwork Mon Sep 6 15:26:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32676 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 705E927BBE4; Mon, 6 Sep 2021 16:28:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B8CD327BBE1 for ; Mon, 6 Sep 2021 16:28:25 +0100 (BST) Received: from localhost ([::1]:48036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXo-0001WX-Q3 for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXT-0000zX-W9 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXT-00070t-NR for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXT-0006oE-K1 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 7/8] gnu: desktop: Add seatd-service-type. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094203626081 (code B ref 49969); Mon, 06 Sep 2021 15:28:03 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:16 +0000 Received: from localhost ([127.0.0.1]:54243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWc-0006mP-Jc for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:16 -0400 Received: from mail-wr1-f50.google.com ([209.85.221.50]:33339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWT-0006kH-Bi for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:08 -0400 Received: by mail-wr1-f50.google.com with SMTP id b10so10436988wru.0 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=uzURvM08dygKJRZZBFmShSsZeHbL0S+O53XjqwFiNqk=; b=Q4x6YuGX283dtELvy1tQg1C86ChWWRxZdvYIwofy+9ptxQ+G2liJgJ3lq+gLA0aII8 GqKpmzkvRmDGO0Ko2D0bel6q274fnk+lGMAavjyUWs8WvENtmaYGlGyIDfm4su6GqG1M poAX7nrBAXjYlaT6KbWgpuzYf+62YNUlquLtkUgbP1wBtoLbwWDmYJTzxRhSsnuj8xO8 KjJsJigWTE+KW3sMyiO2SgJKoc4WnvzseocdcbiRJHnsGy9NdWf9MxoY1dUPaCkVfzGT xZfp1JFlTLQEqPMz8wJ4h4ODMwxehGxAv9pKWk1nsxCqf6DT7kPAcCX91cKnACxfLT9y H90g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uzURvM08dygKJRZZBFmShSsZeHbL0S+O53XjqwFiNqk=; b=OKE0jN4Z2l21QIClLEIedfJjVqwF8zHhL3pvWajAlqCO1/0+8UjMWRS+P9e/67zMFi u3xxE1KlCCtbvQgzRl152JHqR8Ak9MkyZOppFfSQ+l4LzeUPN8jL1YP7HuZ9d2CD49A9 883hagme1IzLvRi9n4LvtRjZ1Wq1fH3IsgdGwS5pHg34N2kvNzwTDXrd3uGINCy+RNz6 uJAimRRY1XrF/R2KVaDqK9vhKlbnH7hT7x4RdFyoRqpNKwIAg1UdnGtpmcxTwmRM+45I 15wSm03Maujm1fzQue5Y0DjIBRZP3kBS2dVsdPsQFb+6bPsaXZzCB1LStvwAA23DHQoM ScbQ== X-Gm-Message-State: AOAM5324pmObB5KPo1Jjmxsn+05LJiJLUhVB7/NqpS8V5BiVmqWv+QNB ftPd1DYyL8GuX/AoILgFdZ4YYq5raByPhS9R X-Google-Smtp-Source: ABdhPJwTGfQw9vcNNacapLoLdq8MY+z0xWAo7H74OmlUIgld2d+5x8INPABBiZfHFjb2+lqKsP2eVw== X-Received: by 2002:adf:9f0d:: with SMTP id l13mr14187514wrf.328.1630942015333; Mon, 06 Sep 2021 08:26:55 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.54 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:54 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:40 +0300 Message-Id: <20210906152641.11020-8-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/desktop.scm (seatd-service-type): New variable --- doc/guix.texi | 42 ++++++++++++++++++++++++++++ gnu/services/desktop.scm | 60 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 79bf291ec4..9c40342f9f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19901,6 +19901,48 @@ and ``passwd'' is with the value @code{passwd}. @end table @end deftp +@defvr {Scheme Variable} seatd-service-type +@uref{https://sr.ht/~kennylevinsen/seatd/, seatd} is a minimal seat +management daemon. + +Seat management takes care of mediating access to shared devices (graphics, +input), without requiring the applications needing access to be root. + +@lisp +(append + (list + ;; make sure seatd is running + (service seatd-service-type)) + + ;; normally one would want %base-services + %base-services) + +@end lisp +@end defvr + +@deftp {Data Type} seatd-configuration +Configuration record for the seatd daemon service. + +@table @asis +@item @code{seatd} (default: @code{seatd}) +The seatd package to use. + +@item @code{user} (default: @samp{"root"}) +User to own the seatd socket. + +@item @code{group} (default: @samp{"users"}) +Group to own the seatd socket. + +@item @code{socket} (default: @samp{"/run/seatd.sock"}) +Where to create the seatd socket. + +@item @code{loglevel} (default: @samp{"error"}) +Log level to output logs. Possible values: @samp{"silent"}, @samp{"error"}, +@samp{"info"} and @samp{"debug"}. + +@end table +@end deftp + @node Sound Services @subsection Sound Services diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 64d0e85301..c42db5987e 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Reza Alizadeh Majd ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,7 +40,9 @@ #:use-module (gnu services networking) #:use-module (gnu services sound) #:use-module ((gnu system file-systems) - #:select (%elogind-file-systems file-system)) + #:select (%control-groups + %elogind-file-systems + file-system)) #:use-module (gnu system) #:use-module (gnu system setuid) #:use-module (gnu system shadow) @@ -154,6 +157,9 @@ gnome-keyring-configuration? gnome-keyring-service-type + seatd-configuration + seatd-service-type + %desktop-services)) ;;; Commentary: @@ -1182,6 +1188,58 @@ or setting its password with passwd."))) (define polkit-wheel-service (simple-service 'polkit-wheel polkit-service-type (list polkit-wheel))) + +;;; +;;; seatd-service-type -- minimal seat management daemon +;;; + +(define-record-type* seatd-configuration + make-seatd-configuration + seatd-configuration? + (seatd seatd-package (default seatd)) + (user seatd-user (default "root")) + (group seatd-group (default "users")) + (socket seatd-socket (default "/run/seatd.sock")) + (loglevel seatd-loglevel (default "error"))) + +(define (seatd-shepherd-service config) + (list (shepherd-service + (documentation "Minimal seat management daemon") + (requirement '()) + ;; TODO: once cgroups is separate dependency + ;; here we should depend on it rather than elogind + (provision '(seatd elogind)) + (start #~(make-forkexec-constructor + (list #$(file-append (seatd-package config) "/bin/seatd") + "-u" #$(seatd-user config) + "-g" #$(seatd-group config) + "-s" #$(seatd-socket config)) + #:environment-variables + (list (string-append "SEATD_LOGLEVEL=" + #$(seatd-loglevel config))) + #:log-file "/tmp/seatd.log")) + (stop #~(make-kill-destructor))))) + +(define seatd-environment + (match-lambda + (($ _ _ _ socket) + `(("SEATD_SOCK" . ,socket))))) + +(define seatd-service-type + (service-type + (name 'seatd) + (description "Seat management takes care of mediating access +to shared devices (graphics, input), without requiring the +applications needing access to be root.") + (extensions + (list + (service-extension session-environment-service-type seatd-environment) + ;; TODO: once cgroups is separate dependency we should not mount it here + ;; for now it is mounted here, because elogind mounts it + (service-extension file-system-service-type (const %control-groups)) + (service-extension shepherd-root-service-type seatd-shepherd-service))) + (default-value (seatd-configuration)))) + ;;; ;;; The default set of desktop services. From patchwork Mon Sep 6 15:26:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: muradm X-Patchwork-Id: 32677 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A5D3F27BBE3; Mon, 6 Sep 2021 16:28:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1370727BBE1 for ; Mon, 6 Sep 2021 16:28:33 +0100 (BST) Received: from localhost ([::1]:48774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNGXw-00020o-4E for patchwork@mira.cbaines.net; Mon, 06 Sep 2021 11:28:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNGXU-00010f-Bd for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNGXU-00071H-3s for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNGXU-0006oL-16 for guix-patches@gnu.org; Mon, 06 Sep 2021 11:28:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v6 8/8] gnu: tests: Add seatd/greetd based minimal desktop system tests. Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 15:28:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.163094203726088 (code B ref 49969); Mon, 06 Sep 2021 15:28:03 +0000 Received: (at 49969) by debbugs.gnu.org; 6 Sep 2021 15:27:17 +0000 Received: from localhost ([127.0.0.1]:54245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWi-0006mc-MV for submit@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:17 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:46030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNGWU-0006kQ-Gp for 49969@debbugs.gnu.org; Mon, 06 Sep 2021 11:27:15 -0400 Received: by mail-wr1-f43.google.com with SMTP id n5so10357896wro.12 for <49969@debbugs.gnu.org>; Mon, 06 Sep 2021 08:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=voj8wbDKGUerUIV4cXxX+kwukU2AaRDxpfHnjUCVMNs=; b=StrQ/sm9rWQzE+Y+Iler7jOx0Koz0Z0lmzieVCHLSMUn2BEZOVV3MBvbJ9vttzsxCJ Rw5wWlWO2LXVTzSjoImhuYHX5BXcNLngasFGTHoeS3Fp0LuOctKTM4ljHRSDNS99Fx9+ qu8ymH0z/TafXGQHywXy4jDRZnT22qcn/ZegXRufyGHPH4Pxp6gPqWuhKu8Uip/D+yKf pzpmLQVoT/NRQuXkmhLoOWrU2yIOb9MXRVcATXZFutXDTOjyXGCxazVTjzgzLVoXVQM2 +QavyiaP2/lt+Cs50kMNaTzVHlMJlvlJIVGLtPfcRWrZgEZio2c2aqokcDPUeCVFcThj eeqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=voj8wbDKGUerUIV4cXxX+kwukU2AaRDxpfHnjUCVMNs=; b=OLCtE9rRV3DW5JB4zOeh0bmNAyjdauJqUt8objmoRQghmBvVk/+AIBTqSfGd4rtgSg jjIxZ19aVV//nOp+ioSeKqujdYbXke2NfFbjOVZ4mBf65Xz8rO5wiufCU/HemGgcbgIQ 9osbwfwYk34GvFbYpVuVA8am8bMgf2ZqcD8CWm79QakUkAldSUt8qFrSqvGNXCrVJdmj XdlPuQsz1UlCrQhHnsAWh86bu75q3qk2xFWaeRjQtEme0Z0j6HvgqZL/WCcUcVctR4Gf 9YPFd7cClKxs29fh3ObXobjPS3wPiBMJfklm8D4McDCz4IHqL8nhccZBus2yo3ACtZiw TUOA== X-Gm-Message-State: AOAM532Fwb1oWjt+I1Hfm3+ePuwUFNtRA6J2Qc0ot96Kg/SZK8J4EDTK vgKZLD8FSEwzON61H1MYCeF6LymEdP9qmT86 X-Google-Smtp-Source: ABdhPJysyHRdZC7J4JpSUnYsSgYKreKBQ8mDeK5um8rK7rxDxixEU/IwHu2CvSAEgnZc8ZInwoFnUA== X-Received: by 2002:adf:f4ca:: with SMTP id h10mr13833175wrp.351.1630942016421; Mon, 06 Sep 2021 08:26:56 -0700 (PDT) Received: from localhost.localdomain ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id m4sm7687896wml.28.2021.09.06.08.26.55 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 08:26:55 -0700 (PDT) From: muradm Date: Mon, 6 Sep 2021 18:26:41 +0300 Message-Id: <20210906152641.11020-9-mail@muradm.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210906152641.11020-1-mail@muradm.net> References: <20210822215048.20480-1-mail@muradm.net> <20210906152641.11020-1-mail@muradm.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/tests/desktop.scm (minimal-desktop): seatd/greetd based minimal desktop --- gnu/tests/desktop.scm | 212 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 211 insertions(+), 1 deletion(-) diff --git a/gnu/tests/desktop.scm b/gnu/tests/desktop.scm index 6aa22fd49b..50aa859869 100644 --- a/gnu/tests/desktop.scm +++ b/gnu/tests/desktop.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ludovic Courtès +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,13 +19,17 @@ (define-module (gnu tests desktop) #:use-module (gnu tests) + #:use-module (gnu packages shells) #:use-module (gnu services) + #:use-module (gnu services base) #:use-module (gnu services dbus) #:use-module (gnu services desktop) + #:use-module (gnu system) #:use-module (gnu system vm) #:use-module (guix gexp) #:use-module (srfi srfi-1) - #:export (%test-elogind)) + #:export (%test-elogind + %test-minimal-desktop)) ;;; @@ -103,3 +108,208 @@ #:imported-modules '((gnu services herd) (guix combinators))))) (run-elogind-test (virtual-machine os)))))) + + +;;; +;;; Seatd/greetd based minimal desktop +;;; + +(define %minimal-services + (append + (modify-services %base-services + ;; greetd-service-type provides "greetd" PAM service + (delete login-service-type) + ;; and can be used in place of mingetty-service-type + (delete mingetty-service-type)) + (list + (service seatd-service-type) + (service greetd-service-type + (greetd-configuration + (terminals + (list + ;; we can make any terminal active by default + (greetd-terminal-configuration (terminal-vt "1") (terminal-switch #t)) + ;; we can make environment without XDG_RUNTIME_DIR set + ;; even provide our own environment variables + (greetd-terminal-configuration + (terminal-vt "2") + (default-session-command + (greetd-agreety-session + (extra-env '(("MY_VAR" . "1"))) + (xdg-env? #f)))) + ;; we can use different shell instead of default bash + (greetd-terminal-configuration + (terminal-vt "3") + (default-session-command + (greetd-agreety-session (command (file-append zsh "/bin/zsh"))))) + ;; we can use any other executable command as greeter + (greetd-terminal-configuration + (terminal-vt "4") + (default-session-command (program-file "my-noop-greeter" #~(exit)))) + (greetd-terminal-configuration (terminal-vt "5")) + (greetd-terminal-configuration (terminal-vt "6")))))) + ;; mingetty-service-type can be used in parallel + ;; if needed to do so, do not (delete login-service-type) + ;; as illustrated above + #| (service mingetty-service-type (mingetty-configuration (tty "tty8"))) |#))) + +(define-syntax-rule (minimal-operating-system user-services ...) + "Return an operating system that includes USER-SERVICES in addition to +minimal %BASE-SERVICES." + (operating-system (inherit %simple-os) + (services (cons* user-services ... %minimal-services)))) + +(define (run-minimal-desktop-test os vm) + (define test + (with-imported-modules '((gnu build marionette) + (guix build syscalls)) + #~(begin + (use-modules (gnu build marionette) + (guix build syscalls) + (srfi srfi-1) + (srfi srfi-64) + (ice-9 pretty-print)) + + (define marionette + (make-marionette #$vm)) + + (define (file-get-all-strings fname) + (marionette-eval '(use-modules (rnrs io ports)) marionette) + (wait-for-file fname marionette #:read 'get-string-all)) + + (define (wait-for-unix-socket-m socket) + (wait-for-unix-socket socket marionette)) + + (mkdir #$output) + (chdir #$output) + + (test-begin "minimal-desktop") + + (test-assert "seatd is ready" + (wait-for-unix-socket-m "/run/seatd.sock")) + + (test-equal "login user on tty1" + "alice\n" + (begin + ;; Wait for tty1. + (marionette-eval + '(begin + (use-modules (gnu services herd)) + (start-service 'term-tty1)) + marionette) + (marionette-control "sendkey ctrl-alt-f1" marionette) + + ;; login as root change alice password and exit + ;; then login as alice + (for-each + (lambda (cmd) (marionette-type cmd marionette) (sleep 1)) + (list + "root\n" + "passwd alice\n" + "alice\n" + "alice\n" + "exit\n" + "alice\n" + "alice\n" + "id -un > logged-in\n")) + + (file-get-all-strings "/home/alice/logged-in"))) + + (test-equal "validate user environment" + '("SEATD_SOCK=/run/seatd.sock" + "XDG_RUNTIME_DIR=/run/user/1000" + "XDG_SEAT=seat0" + "XDG_VTNR=1") + + (begin + (marionette-type "env > env\n" marionette) + (sleep 1) + + (define user-env (string-tokenize + (file-get-all-strings "/home/alice/env"))) + + (define (expected-var var) + (any (lambda (s) (string-contains var s)) + '("SEATD_SOCK" + "XDG_RUNTIME_DIR" + "XDG_SEAT" + "XDG_VTNR"))) + + (sort (filter expected-var user-env) string env\n" marionette) + (sleep 1) + + (define (sock-var? var) + (any (lambda (s) (string-contains var s)) + '("SEATD_SOCK" "GREETD_SOCK"))) + + (define (sock-var-sock var) + (car (cdr (string-split var #\=)))) + + (let* + ((out (file-get-all-strings "/home/alice/env")) + (out (string-tokenize out)) + (out (filter sock-var? out)) + (socks (map sock-var-sock out)) + (socks (map wait-for-unix-socket-m socks))) + (and (= 2 (length socks)) (every identity socks))))) + + (test-assert "greetd is ready" + (begin + (marionette-type "ps -C greetd -o pid,args --no-headers > ps-greetd\n" + marionette) + (sleep 1) + + (define (greetd-daemon? cmd) + (string-contains cmd "config")) + + (define (greetd-cmd-to-pid cmd) + (car (string-split cmd #\space))) + + (define (greetd-pid-to-sock pid) + (string-append "/run/greetd-" pid ".sock")) + + (let* ((out (file-get-all-strings "/home/alice/ps-greetd")) + (out (string-split out #\newline)) + (out (map string-trim-both out)) + (out (filter greetd-daemon? out)) + (pids (map greetd-cmd-to-pid out)) + (socks (map greetd-pid-to-sock pids)) + (socks (map wait-for-unix-socket-m socks))) + (every identity socks)))) + + ;; a bit weak, but tests everything at once actually + (test-equal "check /run/user/ mounted and writable" + "alice\n" + (begin + (marionette-type "echo alice > /run/user/1000/test\n" marionette) + (file-get-all-strings "/run/user/1000/test"))) + + (test-assert "screendump" + (begin + (marionette-control (string-append "screendump " #$output + "/tty1.ppm") + marionette) + (file-exists? "tty1.ppm"))) + + (test-end) + (exit (= (test-runner-fail-count (test-runner-current)) 0))))) + + (gexp->derivation "minimal-desktop" test)) + +(define %test-minimal-desktop + (system-test + (name "minimal-desktop") + (description + "Test whether we can log in when seatd and greetd is enabled") + (value + (let* ((os (marionette-operating-system + (minimal-operating-system) + #:imported-modules '((gnu services herd) + (guix combinators)))) + (vm (virtual-machine os))) + (run-minimal-desktop-test (virtualized-operating-system os '()) + #~(list #$vm))))))