~whereiseveryone/guixrus

guixrus/guixrus/packages/greetd.scm -rw-r--r-- 9.4 KiB
f6f32b39jgart roper: add license 12 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 muradm <mail@muradm.net>
;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com>
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages greetd)
  #:use-module (gnu packages crates-io)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages man)
  #:use-module (gnu packages web)
  #:use-module (gnu packages pkg-config)
  #:use-module (guixrus packages common rust)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages qt)
  #:use-module (guix build-system cargo)
  #:use-module (guix build-system meson))

;;;--> upstream: move into (gnu packages admin);
;;; add modules freedesktop, build-system cargo
(define-public libseat-next
  (package
    (name "libseat-next")
    (version "0.6.2")
    (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
                "0c07i1nq0k60xmcsnr37ryqs7nzbg4qfq6fzbnzwbh1yhr8kypcm"))))
    (build-system meson-build-system)
    (arguments
     `(#:configure-flags '("-Dlibseat-logind=elogind"
                           "-Dserver=disabled")))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (propagated-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-next
  (package
    (inherit libseat-next)
    (name "seatd-next")
    (arguments
     `(#:configure-flags '("-Dlibseat-logind=elogind")
       #: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")
   (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.5)
       ("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
hat 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,
hen 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.")))

;;; greeters - TODO wlgreet, tuigreet (, ddlm)
(define-public qtgreet
  (package
    (name "qtgreet")
    (version "1.0.0")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://gitlab.com/marcusbritanicus/QtGreet")
         (commit "32b9a0f50ef29550f3a25dd0bf8ef1f76ae38139")))
       (sha256
        (base32 "1l4hxhr04kdyazszrpam2r3a2smviffyy0kdzn9iisg9qxbnk0wv"))))
    (native-inputs (list pkg-config))
    (inputs (list qtbase-5 json-c))
    (build-system meson-build-system)
    (synopsis "Qt-based, featureful greeter for greetd")
    (description "This is a Qt-based greeter using a wlroots based
compositor (cage, sway, wayfire) to display a login interface that's
defined via QML.")
    (home-page "https://gitlab.com/marcusbritanicus/QtGreet")
    (license license:expat)))

(define-public gtkgreet
  (package
    (name "gtkgreet")
    (version "0.7")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
        (url "https://git.sr.ht/~kennylevinsen/gtkgreet")
        (commit "c09696f6a27aa0e4769fd3f707f27be4407ec95d")))
       (sha256
        (base32 "1d19v60ilxw4szhc5mbpav5kzml5lvckdy3fasjrhlpl87slvfz9"))))
    (native-inputs
     (list pkg-config scdoc))
    (inputs
     (list gtk+ gtk-layer-shell json-c))
    (build-system meson-build-system)
    (synopsis "GTK based greeter for greetd")
    (description "This is a GTK-based greeter using a wlroots based
compositor (cage, sway, wayfire) to display a login interface.")
    (home-page "https://git.sr.ht/~kennylevinsen/gtkgreet")
    (license license:expat)))