projects/guix·blob sysadmin-team · refs

7169 lines · 288.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012-2026 Ludovic Courtès <[email protected]>
3;;; Copyright © 2013 Cyril Roelandt <[email protected]>
4;;; Copyright © 2013 Nikita Karetnikov <[email protected]>
5;;; Copyright © 2014, 2015, 2016, 2018, 2019, 2020 Mark H Weaver <[email protected]>
6;;; Copyright © 2014, 2015-2018, 2020-2023 Eric Bavier <[email protected]>
7;;; Copyright © 2015, 2016 Taylan Ulrich Bayırlı/Kammer <[email protected]>
8;;; Copyright © 2015 Alex Sassmannshausen <[email protected]>
9;;; Copyright © 2015 Eric Dvorsak <[email protected]>
10;;; Copyright © 2016, 2017, 2020 Leo Famulari <[email protected]>
11;;; Copyright © 2016 Pjotr Prins <[email protected]>
12;;; Copyright © 2016, 2017, 2023 Ricardo Wurmus <[email protected]>
13;;; Copyright © 2016-2025 Efraim Flashner <[email protected]>
14;;; Copyright © 2016 Peter Feigl <[email protected]>
15;;; Copyright © 2016 John J. Foerch <[email protected]>
16;;; Copyright © 2016, 2017 Nikita <[email protected]>
17;;; Copyright © 2016–2022 Tobias Geerinckx-Rice <[email protected]>
18;;; Copyright © 2016 John Darrington <[email protected]>
19;;; Copyright © 2017 Ben Sturmfels <[email protected]>
20;;; Copyright © 2017 Ethan R. Jones <[email protected]>
21;;; Copyright © 2017 Christine Lemmer-Webber <[email protected]>
22;;; Copyright © 2017, 2018, 2020 Marius Bakke <[email protected]>
23;;; Copyright © 2018, 2019 Arun Isaac <[email protected]>
24;;; Copyright © 2018 Pierre-Antoine Rouby <[email protected]>
25;;; Copyright © 2018 Rutger Helling <[email protected]>
26;;; Copyright © 2018 Pierre Neidhardt <[email protected]>
27;;; Copyright © 2019 Brett Gilio <[email protected]>
28;;; Copyright © 2019,2020 Björn Höfling <[email protected]>
29;;; Copyright © 2019 Jakob L. Kreuze <[email protected]>
30;;; Copyright © 2019 Hartmut Goebel <[email protected]>
31;;; Copyright © 2019 Alex Griffin <[email protected]>
32;;; Copyright © 2019, 2021, 2022 Guillaume Le Vaillant <[email protected]>
33;;; Copyright © 2019, 2020, 2021 Mathieu Othacehe <[email protected]>
34;;; Copyright © 2020 Oleg Pykhalov <[email protected]>
35;;; Copyright © 2020, 2023, 2024, 2025 Janneke Nieuwenhuizen <[email protected]>
36;;; Copyright © 2020, 2021, 2022 Michael Rohleder <[email protected]>
37;;; Copyright © 2020 Vincent Legoll <[email protected]>
38;;; Copyright © 2020 Morgan Smith <[email protected]>
39;;; Copyright © 2021-2026 Maxim Cournoyer <[email protected]>
40;;; Copyright © 2021, 2023, 2024 Zheng Junjie <[email protected]>
41;;; Copyright © 2021 Stefan Reichör <[email protected]>
42;;; Copyright © 2021 qblade <[email protected]>
43;;; Copyright © 2021 Hyunseok Kim <[email protected]>
44;;; Copyright © 2021 David Larsson <[email protected]>
45;;; Copyright © 2021 WinterHound <[email protected]>
46;;; Copyright © 2021 Brice Waegeneire <[email protected]>
47;;; Copyright © 2021 Maxime Devos <[email protected]>
48;;; Copyright © 2021 Roel Janssen <[email protected]>
49;;; Copyright © 2021, 2025 muradm <[email protected]>
50;;; Copyright © 2021 pineapples <[email protected]>
51;;; Copyright © 2021 Petr Hodina <[email protected]>
52;;; Copyright © 2021-2026 Artyom V. Poptsov <[email protected]>
53;;; Copyright © 2022 Wamm K. D. <[email protected]>
54;;; Copyright © 2022 Roman Riabenko <[email protected]>
55;;; Copyright © 2022 Petr Hodina <[email protected]>
56;;; Copyright © 2022 Andreas Rammhold <[email protected]>
57;;; Copyright © 2022 ( <[email protected]>
58;;; Copyright © 2022, 2023 Matthew James Kraai <[email protected]>
59;;; Copyright © 2022 jgart <[email protected]>
60;;; Copyright © 2023 Juliana Sims <[email protected]>
61;;; Copyright © 2023 Lu Hui <[email protected]>
62;;; Copyright © 2023 Yovan Naumovski <[email protected]>
63;;; Copyright © 2023 Alexey Abramov <[email protected]>
64;;; Copyright © 2023 Bruno Victal <[email protected]>
65;;; Copyright © 2023 Tobias Kortkamp <[email protected]>
66;;; Copyright © 2023 Jaeme Sifat <[email protected]>
67;;; Copyright © 2023 Nicolas Graves <[email protected]>
68;;; Copyright © 2023 Tomás Ortín Fernández <[email protected]>
69;;; Copyright © 2024 dan <[email protected]>
70;;; Copyright © 2024 gemmaro <[email protected]>
71;;; Copyright © 2024 Richard Sent <[email protected]>
72;;; Copyright © 2024 Vinicius Monego <[email protected]>
73;;; Copyright © 2024 nathan <[email protected]>
74;;; Copyright © 2024 Nikita Domnitskii <[email protected]>
75;;; Copyright © 2024 Roman Scherer <[email protected]>
76;;; Copyright © 2024-2026 Ashish SHUKLA <[email protected]>
77;;; Copyright © 2024 Ashvith Shetty <[email protected]>
78;;; Copyright © 2025 Dariqq <[email protected]>
79;;; Copyright © 2024 nik gaffney <[email protected]>
80;;; Copyright © 2025 Simon Streit <[email protected]>
81;;; Copyright © 2025 Luca Kredel <[email protected]>
82;;; Copyright © 2025 ROCKTAKEY <[email protected]>
83;;; Copyright © 2026 Andreas Enge <[email protected]>
84;;; Copyright © 2026 Luis Guilherme Coelho <[email protected]>
85;;; Copyright © 2026 Andy Tai <[email protected]>
86;;; Copyright © 2026 marderbot <[email protected]>
87;;;
88;;; This file is part of GNU Guix.
89;;;
90;;; GNU Guix is free software; you can redistribute it and/or modify it
91;;; under the terms of the GNU General Public License as published by
92;;; the Free Software Foundation; either version 3 of the License, or (at
93;;; your option) any later version.
94;;;
95;;; GNU Guix is distributed in the hope that it will be useful, but
96;;; WITHOUT ANY WARRANTY; without even the implied warranty of
97;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98;;; GNU General Public License for more details.
99;;;
100;;; You should have received a copy of the GNU General Public License
101;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
102
103(define-module (gnu packages admin)
104 #:use-module (guix build-system cargo)
105 #:use-module (guix build-system cmake)
106 #:use-module (guix build-system copy)
107 #:use-module (guix build-system emacs)
108 #:use-module (guix build-system glib-or-gtk)
109 #:use-module (guix build-system gnu)
110 #:use-module (guix build-system go)
111 #:use-module (guix build-system meson)
112 #:use-module (guix build-system perl)
113 #:use-module (guix build-system pyproject)
114 #:use-module (guix build-system qt)
115 #:use-module (guix build-system ruby)
116 #:use-module (guix build-system trivial)
117 #:use-module (guix download)
118 #:use-module (guix git-download)
119 #:use-module (guix gexp)
120 #:use-module ((guix licenses) #:prefix license:)
121 #:use-module (guix packages)
122 #:use-module (guix platform)
123 #:use-module (guix utils)
124 #:use-module (gnu packages)
125 #:use-module (gnu packages acl)
126 #:use-module (gnu packages algebra)
127 #:use-module (gnu packages attr)
128 #:use-module (gnu packages autotools)
129 #:use-module (gnu packages base)
130 #:use-module (gnu packages bash)
131 #:use-module (gnu packages bison)
132 #:use-module (gnu packages boost)
133 #:use-module (gnu packages c)
134 #:use-module (gnu packages check)
135 #:use-module (gnu packages compression)
136 #:use-module (gnu packages cpp)
137 #:use-module (gnu packages crypto)
138 #:use-module (gnu packages cryptsetup)
139 #:use-module (gnu packages curl)
140 #:use-module (gnu packages cyrus-sasl)
141 #:use-module (gnu packages datastructures)
142 #:use-module (gnu packages dbm)
143 #:use-module (gnu packages debian)
144 #:use-module (gnu packages dns)
145 #:use-module (gnu packages docbook)
146 #:use-module (gnu packages elf)
147 #:use-module (gnu packages file)
148 #:use-module (gnu packages file-systems)
149 #:use-module (gnu packages compiler-tools)
150 #:use-module (gnu packages fonts)
151 #:use-module (gnu packages freedesktop)
152 #:use-module (gnu packages gawk)
153 #:use-module (gnu packages gettext)
154 #:use-module (gnu packages gcc)
155 #:use-module (gnu packages gl)
156 #:use-module (gnu packages glib)
157 #:use-module (gnu packages gnome)
158 #:use-module (gnu packages gnupg)
159 #:use-module (gnu packages golang)
160 #:use-module (gnu packages golang-build)
161 #:use-module (gnu packages golang-check)
162 #:use-module (gnu packages golang-compression)
163 #:use-module (gnu packages golang-crypto)
164 #:use-module (gnu packages golang-web)
165 #:use-module (gnu packages golang-xyz)
166 #:use-module (gnu packages gperf)
167 #:use-module (gnu packages groff)
168 #:use-module (gnu packages gtk)
169 #:use-module (gnu packages guile)
170 #:use-module (gnu packages guile-xyz)
171 #:use-module (gnu packages image)
172 #:use-module (gnu packages imagemagick)
173 #:use-module (gnu packages inkscape)
174 #:use-module (gnu packages kerberos)
175 #:use-module (gnu packages libbsd)
176 #:use-module (gnu packages libunwind)
177 #:use-module (gnu packages libusb)
178 #:use-module (gnu packages linux)
179 #:use-module (gnu packages logging)
180 #:use-module (gnu packages lsof)
181 #:use-module (gnu packages lua)
182 #:use-module (gnu packages m4)
183 #:use-module (gnu packages mail)
184 #:use-module (gnu packages man)
185 #:use-module (gnu packages maths)
186 #:use-module (gnu packages markup)
187 #:use-module (gnu packages mcrypt)
188 #:use-module (gnu packages mpi)
189 #:use-module (gnu packages ncurses)
190 #:use-module (gnu packages nettle)
191 #:use-module (gnu packages networking)
192 #:use-module (gnu packages openldap)
193 #:use-module (gnu packages package-management)
194 #:use-module (gnu packages patchutils)
195 #:use-module (gnu packages pciutils)
196 #:use-module (gnu packages pcre)
197 #:use-module (gnu packages perl)
198 #:use-module (gnu packages perl-check)
199 #:use-module (gnu packages pkg-config)
200 #:use-module (gnu packages polkit)
201 #:use-module (gnu packages python)
202 #:use-module (gnu packages python-build)
203 #:use-module (gnu packages python-check)
204 #:use-module (gnu packages python-crypto)
205 #:use-module (gnu packages python-xyz)
206 #:use-module (gnu packages qt)
207 #:use-module (gnu packages readline)
208 #:use-module (gnu packages regex)
209 #:use-module (gnu packages ruby)
210 #:use-module (gnu packages ruby-check)
211 #:use-module (gnu packages ruby-xyz)
212 #:use-module (gnu packages selinux)
213 #:use-module (gnu packages serialization)
214 #:use-module (gnu packages sqlite)
215 #:use-module (gnu packages ssh)
216 #:use-module (gnu packages sphinx)
217 #:use-module (gnu packages tcl)
218 #:use-module (gnu packages terminals)
219 #:use-module (gnu packages texinfo)
220 #:use-module (gnu packages time)
221 #:use-module (gnu packages tls)
222 #:use-module (gnu packages version-control)
223 #:use-module (gnu packages vulkan)
224 #:use-module (gnu packages web)
225 #:use-module (gnu packages xdisorg)
226 #:use-module (gnu packages xml)
227 #:use-module (gnu packages xorg))
228
229(define-public acct
230 (package
231 (name "acct")
232 (version "6.6.4")
233 (source
234 (origin
235 (method url-fetch)
236 (uri (string-append "mirror://gnu/acct/acct-"
237 version ".tar.gz"))
238 (sha256
239 (base32
240 "0gv6m8giazshvgpvwbng98chpas09myyfw1zr2y7hqxib0mvy5ac"))))
241 (build-system gnu-build-system)
242 (home-page "https://www.gnu.org/software/acct/")
243 (synopsis "Standard login and process accounting utilities")
244 (description
245 "GNU acct provides a means for system administrators to determine
246system usage patterns. It provides information on, for example, connections,
247programs executed, and system resources used.")
248 (license license:gpl3+)))
249
250(define-public aide
251 (package
252 (name "aide")
253 (version "0.19.3")
254 (source
255 (origin
256 (method url-fetch)
257 (uri (string-append "https://github.com/aide/aide/releases/download/v"
258 version "/aide-" version ".tar.gz"))
259 (sha256
260 (base32 "0irz58hmbrq3vci0aixlyap35x59i8nz0whvvl12ihmqnl5if4v5"))))
261 (build-system gnu-build-system)
262 (arguments
263 (list #:configure-flags #~(list "--with-posix-acl"
264 "--with-selinux"
265 "--with-xattr"
266 "--with-config-file=/etc/aide.conf"
267 "--without-fstype")))
268 (native-inputs
269 (list bison flex pkg-config))
270 (inputs
271 (list acl
272 attr
273 libgcrypt
274 libgpg-error
275 libselinux
276 nettle
277 pcre2
278 `(,zlib "static")
279 zlib))
280 (synopsis "File and directory integrity checker")
281 (description
282 "AIDE (Advanced Intrusion Detection Environment) is a file and directory
283integrity checker. It creates a database from the regular expression rules
284that it finds from its configuration files. Once this database is initialized
285it can be used to verify the integrity of the files. It has several message
286digest algorithms that are used to check the integrity of files. All of the
287usual file attributes can be checked for inconsistencies.")
288 (home-page "https://aide.github.io/")
289 (license license:gpl2+)))
290
291(define-public daemontools
292 (package
293 (name "daemontools")
294 (version "0.76")
295 (source (origin
296 (method url-fetch)
297 (uri (string-append
298 "https://cr.yp.to/daemontools/"
299 "daemontools-" version ".tar.gz"))
300 (sha256
301 (base32
302 "07scvw88faxkscxi91031pjkpccql6wspk4yrlnsbrrb5c0kamd5"))
303 (patches (search-patches "daemontools-gcc14.patch"))))
304 (build-system gnu-build-system)
305 (arguments
306 (list #:tests? #f ;; No tests as far as I can tell.
307 #:phases
308 #~(modify-phases %standard-phases
309 (add-after 'unpack 'chdir
310 (lambda _
311 (chdir #$(string-append "daemontools-" version))))
312 (delete 'configure)
313 (add-before 'build 'patch
314 (lambda _
315 (substitute* "src/error.h"
316 (("extern int errno;")
317 "#include <errno.h>"))))
318 (replace 'build
319 (lambda _
320 (invoke "package/compile")))
321 (replace 'install
322 (lambda _
323 (let ((bin (string-append #$output "/bin")))
324 (for-each (lambda (file)
325 (install-file file bin))
326 (find-files "command"))))))))
327 (synopsis "Tools for managing UNIX style services")
328 (description
329 "@code{daemontools} is a collection of tools for managing UNIX
330services.")
331 (license license:public-domain)
332 (home-page "https://cr.yp.to/daemontools.html")))
333
334(define-public detox
335 (package
336 (name "detox")
337 (version "3.0.1")
338 (source (origin
339 (method git-fetch)
340 (uri (git-reference
341 (url "https://github.com/dharple/detox")
342 (commit (string-append "v" version))))
343 (file-name (git-file-name name version))
344 (sha256
345 (base32
346 "0328w1hh279kgb4fn2vwbvwhmr32i7ayp665vs78pgjy84vhgxzy"))))
347 (build-system gnu-build-system)
348 (native-inputs
349 (list autoconf automake bison flex pkg-config))
350 (home-page "https://github.com/dharple/detox")
351 (synopsis "Clean up file names")
352 (description
353 "Detox is a program that renames files to make them easier to work with
354under Unix and related operating systems. Spaces and various other unsafe
355characters (such as \"$\") get replaced with \"_\". ISO 8859-1 (Latin-1)
356characters can be replaced as well, as can UTF-8 characters.")
357 (license license:bsd-3)))
358
359(define-public hetznercloud-cli
360 (package
361 (name "hetznercloud-cli")
362 (version "1.67.0")
363 (source
364 (origin
365 (method git-fetch)
366 (uri (git-reference
367 (url "https://github.com/hetznercloud/cli")
368 (commit (string-append "v" version))))
369 (file-name (git-file-name name version))
370 (sha256
371 (base32 "1py0bq2zynblyq93mv0ixlli7drn3swny4njpxwg4l5iq8cnf168"))))
372 (build-system go-build-system)
373 (arguments
374 (list
375 #:tests? #f
376 #:install-source? #f
377 #:import-path "github.com/hetznercloud/cli/cmd/hcloud"
378 #:unpack-path "github.com/hetznercloud/cli"
379 #:test-subdirs #~(list "../../...") ;test the whole library
380 #:phases
381 #~(modify-phases %standard-phases
382 (add-after 'install 'install-completions
383 (lambda _
384 (define (install-completion shell file)
385 (let ((file (string-append #$output file)))
386 (mkdir-p (dirname file))
387 (with-output-to-file file
388 (lambda _
389 (invoke (string-append #$output "/bin/hcloud")
390 "completion" shell)))))
391 (install-completion "bash" "/share/bash-completion/completions/hcloud")
392 (install-completion "fish" "/share/fish/vendor_completions.d/hcloud.fish")
393 (install-completion "zsh" "/share/zsh/site-functions/_hcloud"))))))
394 (native-inputs
395 (list go-github-com-burntsushi-toml
396 go-github-com-cheggaaa-pb-v3
397 go-github-com-dustin-go-humanize
398 go-github-com-fatih-color
399 go-github-com-fatih-structs
400 go-github-com-goccy-go-yaml
401 go-github-com-guptarohit-asciigraph
402 go-github-com-hetznercloud-hcloud-go-v2
403 go-github-com-jedib0t-go-pretty-v6
404 go-github-com-spf13-cast
405 go-github-com-spf13-cobra
406 go-github-com-spf13-pflag
407 go-github-com-spf13-viper
408 go-github-com-stretchr-testify
409 go-github-com-swaggest-assertjson
410 go-go-uber-org-mock
411 go-golang-org-x-crypto
412 go-golang-org-x-exp
413 go-golang-org-x-net
414 go-golang-org-x-term
415 go-golang-org-x-text))
416 (home-page "https://github.com/hetznercloud/cli")
417 (synopsis "Command-line interface for the Hetzner Cloud service")
418 (description
419 "This package provides the @code{hcloud} binary, a command-line interface
420for interacting with the @url{https://www.hetzner.com/,Hetzner Cloud}
421service.")
422 (license license:expat)))
423
424(define-public hungrycat
425 (package
426 (name "hungrycat")
427 (version "0.4.2")
428 (source
429 (origin
430 (method git-fetch)
431 (uri (git-reference
432 (url "https://github.com/jwilk/hungrycat/")
433 (commit version)))
434 (file-name (git-file-name name version))
435 (sha256
436 (base32 "0llfb7kh2k53aqwc1fagw77fmwhvwdxd5qlg0fyrhqq298gj8wif"))))
437 (build-system gnu-build-system)
438 (arguments
439 (list
440 ;; tests: Files=2, Tests=2334, 1 wallclock secs
441 #:test-target "test"
442 #:make-flags
443 #~(list (string-append "CC=" #$(cc-for-target)))
444 #:phases
445 #~(modify-phases %standard-phases
446 (add-after 'build 'build-doc
447 (lambda _
448 (invoke "make" "-C" "doc"))))))
449 (native-inputs
450 (list automake
451 autoconf
452 cppcheck
453 perl
454 perl-ipc-run
455 python-docutils))
456 (synopsis "Single tool that combines @command{cat} & @command{rm}")
457 (description
458 "hungrycat prints the contents of a file to standard output, while
459simultaneously freeing the disk space it occupied. It is useful if you need
460to process a large file, don't have enough space to store both the input and
461output files, and don't need the input file afterwards.
462While similar in principle to running @command{cat} immediately followed by
463@command{rm}, @command{hungrycat} actually frees blocks as soon as they are
464printed instead of after the entire file has been read, which is often too
465late.")
466 (home-page "https://jwilk.net/software/hungrycat")
467 (license license:expat)))
468
469;; This package uses su instead of sudo (because of SpaceFM).
470(define-public ktsuss
471 (package
472 (name "ktsuss")
473 (version "2.1")
474 (source
475 (origin
476 (method git-fetch)
477 (uri
478 (git-reference
479 (url "https://github.com/nomius/ktsuss")
480 (commit version)))
481 (sha256
482 (base32 "0q9931f9hp47v1n8scli4bdg2rkjpf5jf8v7jj2gdn83aia1r2hz"))
483 (file-name (git-file-name name version))))
484 (build-system glib-or-gtk-build-system)
485 (arguments
486 (list
487 #:configure-flags
488 #~(list "CFLAGS=-g -O2 -Wno-error=implicit-function-declaration")
489 #:phases
490 #~(modify-phases %standard-phases
491 (add-after 'unpack 'patch-file-names
492 (lambda _
493 (substitute* "configure.ac"
494 (("supath=`which su 2>/dev/null`")
495 "supath=/run/privileged/bin/su")))))))
496 (native-inputs
497 (list autoconf automake libtool pkg-config))
498 (inputs
499 (list glib gtk+-2))
500 (synopsis "Graphical front end for @command{su}")
501 (description
502 "Ktsuss stands for ``Keep the @command{su} simple, stupid''.
503It is a graphical version of @command{su} written in C and GTK+ 2, with
504simplicity in mind.")
505 (home-page "https://github.com/nomius/ktsuss")
506 (license license:bsd-3)))
507
508(define-public progress
509 (package
510 (name "progress")
511 (version "0.17")
512 (source
513 (origin
514 (method git-fetch)
515 (uri (git-reference
516 (url "https://github.com/Xfennec/progress")
517 (commit (string-append "v" version))))
518 (sha256
519 (base32 "1cg1vdk2891sdcbn7yc9a6mzdxplm63qsk1kq0jr4j8ym28v09xf"))
520 (file-name (git-file-name name version))))
521 (build-system gnu-build-system)
522 (native-inputs
523 (list pkg-config which))
524 (inputs
525 (list ncurses))
526 (arguments
527 (list #:tests? #f ; no test suite
528 #:make-flags
529 #~(list (string-append "CC=" #$(cc-for-target))
530 (string-append "PKG_CONFIG=" #$(pkg-config-for-target))
531 (string-append "PREFIX=" #$output))
532 #:phases
533 #~(modify-phases %standard-phases
534 (delete 'configure)))) ; no configure script
535 (home-page "https://github.com/Xfennec/progress")
536 (synopsis "Program to view the progress of the coreutils commands")
537 (description "A program that looks for coreutils basic commands (cp, mv,
538dd, tar, gzip/gunzip, cat, etc.) currently running on your system and displays
539the percentage of copied data. It can also show estimated time and throughput,
540and provides a \"top-like\" mode (monitoring).")
541 (license license:gpl3+)))
542
543(define-public shepherd-0.10
544 (package
545 (name "shepherd")
546 (version "0.10.5")
547 (source (origin
548 (method url-fetch)
549 (uri (string-append "mirror://gnu/shepherd/shepherd-"
550 version ".tar.gz"))
551 (sha256
552 (base32
553 "0k40n9qm5r5rqf94isa1857ghd4329zc5rjf3ll2572gpiw3ij4x"))))
554 (build-system gnu-build-system)
555 (arguments
556 (list #:configure-flags #~'("--localstatedir=/var")
557 #:make-flags #~'("GUILE_AUTO_COMPILE=0")
558 #:phases (if (%current-target-system)
559 #~(modify-phases %standard-phases
560 (add-before 'configure 'set-fibers-directory
561 (lambda _
562 ;; When cross-compiling, refer to the target
563 ;; Fibers, not the native one.
564 (substitute* '("herd.in" "shepherd.in")
565 (("%FIBERS_SOURCE_DIRECTORY%")
566 #$(file-append
567 (this-package-input "guile-fibers")
568 "/share/guile/site/3.0"))
569 (("%FIBERS_OBJECT_DIRECTORY%")
570 #$(file-append
571 (this-package-input "guile-fibers")
572 "/lib/guile/3.0/site-ccache"))))))
573 #~%standard-phases)))
574 (native-inputs (list pkg-config guile-3.0
575 ;; Work around
576 ;; <https://github.com/wingo/fibers/issues/89>. This
577 ;; affects any system without a functional real-time
578 ;; clock (RTC), but in practice these are typically Arm
579 ;; single-board computers.
580 (if (or (target-arm?)
581 (target-riscv64?))
582 guile-fibers-1.1
583 guile-fibers-1.3))) ;pinned version to avoid rebuilds
584 (propagated-inputs (list (this-package-native-input "guile-fibers")))
585 (inputs (list guile-3.0))
586 (synopsis "System service manager")
587 (description
588 "The GNU Shepherd is a daemon-managing daemon, meaning that it supervises
589the execution of system services, replacing similar functionality found in
590typical init systems. It provides dependency-handling through a convenient
591interface and is based on GNU Guile.")
592 (license license:gpl3+)
593 (home-page "https://www.gnu.org/software/shepherd/")))
594
595(define-public shepherd-1.0
596 (package
597 (inherit shepherd-0.10)
598 (version "1.0.9")
599 (source (origin
600 (method url-fetch)
601 (uri (string-append "mirror://gnu/shepherd/shepherd-"
602 version ".tar.gz"))
603 (sha256
604 (base32
605 "1mh080060lnycys8yq6kkiy363wif8dsip3nyklgd3a1r22wb274"))))
606 (arguments
607 (list
608 #:configure-flags
609 #~(list "--localstatedir=/var"
610 ;; Gzip and zstd are used by the log rotation service.
611 (string-append "--with-gzip=" #$(this-package-input "gzip")
612 "/bin/gzip")
613 (string-append "--with-zstd=" #$(this-package-input "zstd")
614 "/bin/zstd"))
615 #:make-flags #~'("GUILE_AUTO_COMPILE=0")
616 #:phases (if (%current-target-system)
617 #~(modify-phases %standard-phases
618 (add-before 'configure 'set-fibers-directory
619 (lambda* (#:key inputs #:allow-other-keys)
620 ;; When cross-compiling, refer to the target
621 ;; Fibers, not the native one.
622 (let ((fibers
623 (search-input-file
624 inputs
625 "share/guile/site/3.0/fibers.scm"))
626 (fibers-go
627 (search-input-file
628 inputs
629 "lib/guile/3.0/site-ccache/fibers.go")))
630 (substitute* '("herd.in" "shepherd.in")
631 (("%FIBERS_SOURCE_DIRECTORY%")
632 (dirname fibers))
633 (("%FIBERS_OBJECT_DIRECTORY%")
634 (dirname fibers-go)))))))
635 #~%standard-phases)))
636 (native-inputs
637 (modify-inputs native-inputs
638 (replace "guile-fibers"
639 ;; Work around <https://codeberg.org/guile/fibers/issues/89>.
640 ;; This affects any system without a functional real-time
641 ;; clock (RTC), but in practice these are typically
642 ;; single-board computers.
643 (if (or (target-arm?)
644 (target-riscv64?))
645 guile-fibers-1.1
646 guile-fibers)))) ;use latest guile-fibers available
647 (propagated-inputs
648 (modify-inputs propagated-inputs
649 (replace "guile-fibers"
650 (this-package-native-input "guile-fibers"))))
651 (inputs
652 (modify-inputs inputs
653 (append gzip zstd)))))
654
655(define-public shepherd shepherd-0.10)
656
657(define-public shepherd-for-home
658 ;; Variant of shepherd without 'sbin' to not shadow 'halt' and 'reboot' on
659 ;; foreign distributions.
660 (let ((base shepherd-1.0))
661 (hidden-package
662 (package/inherit base
663 (name "shepherd-for-home")
664 (source #f)
665 (build-system trivial-build-system)
666 (arguments
667 (list
668 #:modules '((guix build union)
669 (guix build utils))
670 #:builder
671 #~(begin
672 (use-modules (guix build union)
673 (guix build utils))
674 (union-build #$output
675 (list #$(this-package-input "shepherd"))
676 #:create-all-directories? #t)
677 (delete-file-recursively
678 (string-append #$output "/sbin"))
679 (delete-file-recursively
680 (string-append #$output "/share/man/man8")))))
681 (synopsis
682 "The Shepherd for Guix Home, without @command{halt} and @command{reboot}")
683 (native-inputs '())
684 (inputs (list base))
685 (propagated-inputs '())))))
686
687(define-public shepherd-run
688 (package
689 (name "shepherd-run")
690 (version "0.2.0")
691 (source (origin
692 (method git-fetch)
693 (uri (git-reference
694 (url "https://git.sr.ht/~efraim/shepherd-run")
695 (commit version)))
696 (file-name (git-file-name name version))
697 (sha256
698 (base32
699 "0mvn5qi4bq9nsb1462pbzssb1z5w2s160lqd2ps3rjjc4z3f3gjj"))))
700 (build-system gnu-build-system)
701 (arguments
702 (list
703 #:make-flags #~(list (string-append "PREFIX=" #$output))
704 #:phases
705 #~(modify-phases %standard-phases
706 (delete 'configure) ; No configure script.
707 ;; First 'check checks the shell script which loads the gawk code.
708 ;; This 'check checks the installed gawk script.
709 (add-after 'patch-shebangs 'check-again
710 (lambda args
711 (apply (assoc-ref %standard-phases 'check)
712 (append args
713 (list #:make-flags
714 (list (string-append "BINARY=" %output
715 "/bin/shepherd-run"))))))))))
716 (native-inputs (list diffutils help2man))
717 (inputs (list gawk))
718 (synopsis "Create GNU Shepherd services from the command line")
719 (description
720 "Shepherd-run is a script which assists in creating one-off shepherd
721services from the command line. It is meant to partially fill the void left
722by @command{systemd-run}, since GNU Guix uses GNU Shepherd as its system service
723manager.")
724 (home-page "https://git.sr.ht/~efraim/shepherd-run")
725 (license license:gpl3+)))
726
727(define-public swineherd
728 (package
729 (name "swineherd")
730 (version "0.0.5")
731 (source (origin
732 (method git-fetch)
733 (uri (git-reference
734 (url "https://github.com/BIMSBbioinfo/swineherd")
735 (commit (string-append "v" version))))
736 (file-name (git-file-name name version))
737 (sha256
738 (base32
739 "1w3fvkdmqvbzqfx3xindm8qgam54wja46isgwasaiqmmhnla7p52"))))
740 (build-system gnu-build-system)
741 (arguments
742 '(#:configure-flags '("--localstatedir=/var")
743 #:make-flags '("GUILE_AUTO_COMPILE=0")))
744 (native-inputs
745 (list autoconf automake guile-3.0 pkg-config texinfo))
746 (propagated-inputs
747 (list btrfs-progs
748 guile-config
749 guile-fibers-1.3
750 guile-netlink
751 (lookup-package-input guix "guile")
752 guix
753 shepherd-1.0))
754 (home-page "https://github.com/BIMSBbioinfo/swineherd")
755 (synopsis "System container manager")
756 (description
757 "This project aims to provide an extension to the Shepherd, retraining it
758as a swineherd, a manager of crude system containers. It does this by
759providing a Shepherd service @code{swineherd} that talks to the Shepherd
760process to create Guix System containers as Shepherd services. It also comes
761with an optional HTTP API server.")
762 (license license:gpl3+)))
763
764(define-public cfm
765 (package
766 (name "cfm")
767 (version "0.6.6")
768 (source
769 (origin
770 (method git-fetch)
771 (uri (git-reference
772 (url "https://github.com/WillEccles/cfm")
773 (commit (string-append "v" version))))
774 (file-name (git-file-name name version))
775 (sha256
776 (base32 "14gapia902f29wa4dlrrj8jcwcff9bfvyhjccw9ddy2gxx2g8wmr"))))
777 (build-system gnu-build-system)
778 (arguments
779 `(#:tests? #f ; no test suite
780 #:make-flags
781 (list (string-append "CC=" ,(cc-for-target))
782 (string-append "PREFIX=" (assoc-ref %outputs "out")))
783 #:phases
784 (modify-phases %standard-phases
785 ;; Keeping xdg-open optional avoids a size increase of 293%.
786 (delete 'configure)))) ; no configure script
787 (home-page "https://eccles.dev/cfm/")
788 (synopsis
789 "Simple terminal file manager with @command{vi}-inspired key bindings")
790 (description
791 "The Cactus File Manager (@command{cfm}) helps you manage your files
792visually from a text terminal. It aims to be simple and fast, with key bindings
793inspired by @command{vi}.")
794 (license license:mpl2.0)))
795
796(define-public cloud-utils
797 (package
798 (name "cloud-utils")
799 (version "0.33")
800 (source
801 (origin
802 (method url-fetch)
803 (uri (string-append
804 "https://launchpad.net/cloud-utils/trunk/"
805 version "/+download/cloud-utils-" version ".tar.gz"))
806 (sha256
807 (base32
808 "0xxdi55lzw7j91zfajw7jhd2ilsqj2dy04i9brlk8j3pvb5ma8hk"))))
809 (build-system gnu-build-system)
810 (arguments
811 '(#:modules
812 ((guix build gnu-build-system)
813 (guix build utils)
814 (srfi srfi-26))
815 #:make-flags
816 (let ((out (assoc-ref %outputs "out")))
817 (list (string-append "BINDIR=" out "/bin")
818 (string-append "MANDIR=" out "/share/man/man1")
819 (string-append "DOCDIR=" out "/share/doc")))
820 #:phases
821 (modify-phases %standard-phases
822 (delete 'configure)
823 (delete 'check)
824 (add-after 'install 'wrap
825 (lambda* (#:key outputs inputs #:allow-other-keys)
826 (let ((growpart (string-append (assoc-ref outputs "out")
827 "/bin/growpart")))
828 (wrap-program growpart
829 `("PATH" ":" prefix
830 ,(map dirname
831 (map (cut search-input-file inputs <>)
832 (list "bin/readlink"
833 "sbin/sfdisk"
834 "bin/sed"
835 "bin/grep"
836 "bin/awk"
837 "bin/udevadm"
838 "bin/flock")))))))))))
839 (inputs
840 (list bash-minimal ;for wrap-program
841 coreutils ;for readlink and cat
842 sed ;growpart
843 grep ;growpart
844 gawk ;awk for growpart
845 eudev ;udevadm for growpart
846 python
847 util-linux)) ;sfdisk, flock, partx, blkid for growpart
848 (home-page "https://launchpad.net/cloud-utils")
849 (synopsis "Set of utilities for cloud computing environments")
850 (description
851 "This package contains a set of utilities for cloud computing
852environments:
853
854@itemize @bullet
855@item @command{cloud-localds} Create a disk for cloud-init to utilize nocloud
856@item @command{cloud-publish-image} Wrapper for cloud image publishing
857@item @command{cloud-publish-tarball} Wrapper for publishing cloud tarballs
858@item @command{cloud-publish-ubuntu} Import a Ubuntu cloud image
859@item @command{ec2metadata} Query and display @acronym{EC2,Amazon Elastic
860 Compute Cloud} metadata
861@item @command{growpart} Grow a partition to fill the device
862@item @command{mount-image-callback} Mount a file and run a command
863@item @command{resize-part-image} Resize a partition image to a new size
864@item @command{ubuntu-cloudimg-query} Get the latest Ubuntu
865 @acronym{AMI,Amazon Machine Image}
866@item @command{ubuntu-ec2-run} Run a @acronym{EC2,Amazon Elastic Compute
867 Cloud} instance using Ubuntu
868@item @command{vcs-run} Obtain a repository, and run a command
869@item @command{write-mime-multipart} Handle multipart
870 @acronym{MIME,Multipurpose Internet Mail Extensions} messages
871@end itemize")
872 (license license:gpl3)))
873
874(define-public collectl
875 (package
876 (name "collectl")
877 (version "4.3.1")
878 (source
879 (origin
880 (method url-fetch)
881 (uri (string-append
882 "mirror://sourceforge/collectl/collectl/collectl-" version
883 "/collectl-" version ".src.tar.gz"))
884 (sha256
885 (base32 "1wc9k3rmhqzh6cx5dcpqhlc3xcpadsn2ic54r19scdjbjx6jd1r1"))))
886 (build-system gnu-build-system)
887 (arguments
888 (list
889 #:tests? #f ; There are no tests.
890 #:phases
891 #~(modify-phases %standard-phases
892 (delete 'build) ; There's nothing to build.
893 (replace 'configure
894 (lambda _
895 (substitute* "INSTALL"
896 (("DESTDIR:=\"/\"") (format #f "DESTDIR:=~s" #$output))
897 (("DESTDIR/usr") "DESTDIR"))))
898 (replace 'install
899 (lambda _
900 (substitute* "collectl"
901 (("\\$configFile='';")
902 (string-append "$configFile='" #$output "/etc';")))
903 (invoke "./INSTALL"))))))
904 (inputs
905 (list perl))
906 (home-page "http://collectl.sourceforge.net")
907 (synopsis "Performance data collector")
908 (description
909 "This package provides a program that collects various performance
910measurement data like CPU, memory, disk and network performance numbers.")
911 (license license:artistic2.0)))
912
913(define-public daemonize
914 (package
915 (name "daemonize")
916 (version "1.7.8")
917 (source
918 (origin
919 (method git-fetch)
920 (uri (git-reference
921 (url "https://github.com/bmc/daemonize")
922 (commit (string-append "release-" version))))
923 (file-name (git-file-name name version))
924 (sha256
925 (base32 "0w4g0iyssyw7dd0061881z8s5czcl01mz6v00znax57zfxjqpvnm"))))
926 (build-system gnu-build-system)
927 (arguments '(#:tests? #f)) ; No tests available.
928 (home-page "https://software.clapper.org/daemonize/")
929 (synopsis "Command line utility to run a program as a daemon")
930 (description
931 "daemonize runs a command as a Unix daemon. It will close all open file
932descriptors, change working directory of the process to the root filesystem,
933reset its umask, run in the background, ignore I/O signals, handle
934@code{SIGCHLD}, etc. Most programs that are designed to be run as daemons do
935that work for themselves. However, you’ll occasionally run across one that
936does not. When you must run a daemon program that does not properly make
937itself into a true Unix daemon, you can use daemonize to force it to run as a
938true daemon.")
939 (license license:bsd-3)))
940
941(define-public dfc
942 (package
943 (name "dfc")
944 (version "3.1.1")
945 (source
946 (origin
947 (method url-fetch)
948 (uri (string-append
949 "https://projects.gw-computing.net/attachments/download/615/dfc-"
950 version ".tar.gz"))
951 (sha256
952 (base32
953 "0m1fd7l85ckb7bq4c5c3g257bkjglm8gq7x42pkmpp87fkknc94n"))))
954 (build-system cmake-build-system)
955 (arguments '(#:tests? #f)) ; There are no tests.
956 (native-inputs (list gettext-minimal))
957 (home-page "https://projects.gw-computing.net/projects/dfc")
958 (synopsis "Display file system space usage using graphs and colors")
959 (description
960 "dfc (df color) is a modern version of df. It uses colors, draws pretty
961graphs and can export its output to different formats.")
962 (license license:bsd-3)))
963
964(define-public facter
965 (package
966 (name "facter")
967 (version "4.4.1")
968 (source (origin
969 (method git-fetch)
970 (uri (git-reference
971 (url "https://github.com/puppetlabs/facter")
972 (commit version)))
973 (file-name (git-file-name name version))
974 (sha256
975 (base32
976 "080v0ml2svw2vbzfa659v8718pmhh2kav0l0q1jjvc6mm8sgnmmn"))))
977 (build-system ruby-build-system)
978 (arguments
979 (list
980 #:phases
981 #~(modify-phases %standard-phases
982 (add-after 'unpack 'delete-facter-ng-gemspec
983 (lambda _
984 ;; XXX: ruby-build-system incorrectly finds
985 ;; facter-ng.gemspec from this directory and tries to
986 ;; build that instead of the proper facter.gemspec.
987 ;; Just delete it as a workaround, as it appears to
988 ;; only exist for backwards-compatibility after the
989 ;; facter-ng->facter rename.
990 (delete-file "agent/facter-ng.gemspec")))
991 (add-after 'unpack 'embed-absolute-references
992 ;; Refer to absolute executable file names to avoid propagation.
993 (lambda* (#:key inputs #:allow-other-keys)
994 (substitute* (find-files "lib/facter/resolvers" "\\.rb$")
995 (("execute\\('(which |)([^ ']+)" _ _ name)
996 (string-append "execute('" (or (which name)
997 name))))))
998 (delete 'check)
999 (add-after 'wrap 'check
1000 (lambda* (#:key tests? outputs #:allow-other-keys)
1001 ;; XXX: The test suite wants to run Bundler and
1002 ;; complains that the gemspec is invalid. For now
1003 ;; just make sure that we can run the wrapped
1004 ;; executable directly.
1005 (if tests?
1006 (invoke (string-append (assoc-ref outputs "out")
1007 "/bin/facter")
1008 ;; Many facts depend on /sys, /etc/os-release,
1009 ;; etc, so we only run a small sample.
1010 "facterversion" "architecture"
1011 "kernel" "kernelversion")
1012 (format #t "tests disabled~%")))))))
1013 (inputs
1014 (list ruby-hocon
1015 ruby-sys-filesystem
1016 ruby-thor
1017
1018 ;; For ‘embed-absolute-references’.
1019 dmidecode
1020 inetutils ; for ‘hostname’
1021 iproute
1022 pciutils
1023 util-linux))
1024 (synopsis "Collect and display system facts")
1025 (description
1026 "Facter is a tool that gathers basic facts about nodes (systems) such
1027as hardware details, network settings, OS type and version, and more. These
1028facts can be collected on the command line with the @command{facter} command
1029or via the @code{facter} Ruby library.")
1030 (home-page "https://github.com/puppetlabs/facter")
1031 (license license:expat)))
1032
1033(define-public ttyload
1034 (let ((revision "1")
1035 (commit "f9495372801ce4b4dad98ad854203e694c31c1eb"))
1036 (package
1037 (name "ttyload")
1038 (version (git-version "0.5.3" revision commit))
1039 (source
1040 (origin
1041 (method git-fetch)
1042 (uri (git-reference
1043 (url "https://github.com/lindes/ttyload")
1044 (commit commit)))
1045 (file-name (git-file-name name version))
1046 (sha256
1047 (base32 "0ldb7a13b9v876c6cbrs78pkizj64drnqx95z5shfbwgpwfhr4im"))))
1048 (build-system gnu-build-system)
1049 (arguments
1050 (list #:tests? #f ; no tests
1051 #:make-flags
1052 #~(list (string-append "CC=" #$(cc-for-target)))
1053 #:phases
1054 #~(modify-phases %standard-phases
1055 (delete 'configure)
1056 (replace 'install
1057 (lambda _
1058 (let ((bin (string-append #$output "/bin")))
1059 (install-file "ttyload" bin)))))))
1060 (home-page "https://www.daveltd.com/src/util/ttyload/")
1061 (synopsis "Console based color-coded graphs of CPU load average")
1062 (description
1063 "Show graphs for 1 minute, 5 minute, 15 minute load averages on the
1064console.")
1065 ;; This package uses a modified version of the "ISC License".
1066 (license (license:non-copyleft "file://LICENSE")))))
1067
1068(define-public btop
1069 (package
1070 (name "btop")
1071 (version "1.4.7")
1072 (source (origin
1073 (method git-fetch)
1074 (uri (git-reference
1075 (url "https://github.com/aristocratos/btop")
1076 (commit (string-append "v" version))))
1077 (file-name (git-file-name name version))
1078 (sha256
1079 (base32
1080 "0d3cr5l6gpcwhxgnrizny5b5kg6fys2hy9a58bc68w4n2hc040fy"))))
1081 (build-system gnu-build-system)
1082 (native-inputs (list lowdown))
1083 (arguments
1084 (list #:tests? #f ;no test suite
1085 #:make-flags #~(list (string-append "PREFIX=" #$output)
1086 (string-append "CC=" #$(cc-for-target))
1087 (string-append "CXX=" #$(cxx-for-target)))
1088 #:phases #~(modify-phases %standard-phases
1089 (delete 'configure))))
1090 (home-page "https://github.com/aristocratos/btop")
1091 (synopsis "Resource monitor")
1092 (description "Btop++ provides unified monitoring of CPU, memory, network
1093and processes.")
1094 (license license:asl2.0)))
1095
1096(define-public smem
1097 (package
1098 (name "smem")
1099 (version "1.5")
1100 (source (origin
1101 (method url-fetch)
1102 (uri (string-append "https://selenic.com/repo/smem/archive/"
1103 version ".tar.bz2"))
1104 (file-name
1105 (string-append name "-" version ".tar.bz2"))
1106 (sha256
1107 (base32
1108 "19ibv1byxf2b68186ysrgrhy5shkc5mc69abark1h18yigp3j34m"))))
1109 (build-system gnu-build-system)
1110 (arguments
1111 (list #:tests? #f ; There is no test suite.
1112 #:make-flags #~(list "smemcap")
1113 #:phases
1114 #~(modify-phases %standard-phases
1115 (delete 'configure)
1116 (replace 'build
1117 (lambda _
1118 (let* ((system #$(cond ((target-x86?) "X86")
1119 ((target-arm?) "ARM")
1120 ((target-powerpc?) "POWER")
1121 (else "CROSS_FINGERS"))))
1122 (format #t "Building for ~a~%" system)
1123 (invoke #$(cc-for-target) "-o" "smemcap" "smemcap.c"
1124 "-g" "-Wall" "-D" system))))
1125 (replace 'install
1126 (lambda _
1127 (let ((bin (string-append #$output "/bin"))
1128 (man1 (string-append #$output "/share/man/man8")))
1129 (install-file "smemcap" bin)
1130 (install-file "smem" bin)
1131 (mkdir-p man1)
1132 (copy-file "smem.8" (string-append man1 "/smem.8"))))))))
1133 (native-inputs (list python-minimal-wrapper))
1134 (home-page "https://www.selenic.com/smem/")
1135 (synopsis "Memory reporting tool")
1136 (description
1137 "This package provides a command line tool that can give numerous reports
1138on memory usage on GNU/Linux systems.")
1139 (license license:gpl2+)))
1140
1141(define-public htop
1142 (package
1143 (name "htop")
1144 (version "3.5.3")
1145 (source
1146 (origin
1147 (method git-fetch)
1148 (uri (git-reference
1149 (url "https://github.com/htop-dev/htop")
1150 (commit version)))
1151 (sha256
1152 (base32 "04qyyb3nhxbab20nwflg66zd8ycf9yjdfj8fmvv2a95cnm6brfgh"))
1153 (file-name (git-file-name name version))))
1154 (build-system gnu-build-system)
1155 (arguments
1156 (list
1157 #:configure-flags
1158 #~(list "--enable-sensors")
1159 #:phases
1160 #~(modify-phases %standard-phases
1161 (add-after 'unpack 'patch-dlopen
1162 (lambda* (#:key inputs #:allow-other-keys)
1163 (substitute* "linux/LibSensors.c"
1164 (("dlopen\\(\"libsensors\\.so")
1165 (string-append "dlopen(\""
1166 (search-input-file
1167 inputs "/lib/libsensors.so")))))))))
1168 (inputs
1169 (list ncurses (list lm-sensors "lib")))
1170 (native-inputs
1171 (list autoconf automake python-minimal-wrapper)) ; for scripts/MakeHeader.py
1172 (home-page "https://htop.dev")
1173 (synopsis "Interactive process viewer")
1174 (description
1175 "This is htop, an interactive process viewer. It is a text-mode
1176application (for console or X terminals) and requires ncurses.")
1177 (license license:gpl2)))
1178
1179(define-public bashtop
1180 (package
1181 (name "bashtop")
1182 (version "0.9.25")
1183 (source (origin
1184 (method git-fetch)
1185 (uri (git-reference
1186 (url "https://github.com/aristocratos/bashtop")
1187 (commit (string-append "v" version))))
1188 (file-name (git-file-name name version))
1189 (sha256
1190 (base32
1191 "07nlr6vmyb7yihaxj1fp424lmhwkdjl6mls92v90f6gsvikpa13v"))))
1192 (build-system gnu-build-system)
1193 (arguments
1194 '(#:make-flags (list (string-append "PREFIX=" %output))
1195 #:tests? #f ; bats test fails with loading load.bash
1196 #:phases (modify-phases %standard-phases (delete 'configure))))
1197 (home-page "https://github.com/aristocratos/bashtop")
1198 (synopsis "Linux/OSX/FreeBSD resource monitor")
1199 (description "Resource monitor that shows usage and stats for processor,
1200memory, disks, network and processes.")
1201 (license license:asl2.0)))
1202
1203(define-public bpytop
1204 (package
1205 (name "bpytop")
1206 (version "1.0.68")
1207 (source
1208 (origin
1209 (method url-fetch)
1210 (uri (pypi-uri "bpytop" version))
1211 (sha256
1212 (base32 "1clvajbv7pzlya9s1xs6dvjic8rv3kx7aqiwnjxapiypx246gdjk"))))
1213 (build-system pyproject-build-system)
1214 (arguments
1215 (list
1216 #:tests? #f ; No tests in Pypi archive.
1217 #:phases
1218 #~(modify-phases %standard-phases
1219 (add-after 'unpack 'use-poetry-core
1220 (lambda _
1221 ;; Patch to use the core poetry API.
1222 (substitute* "pyproject.toml"
1223 (("poetry.masonry.api")
1224 "poetry.core.masonry.api"))))
1225 (add-after 'install 'install-themes
1226 (lambda* (#:key inputs outputs #:allow-other-keys)
1227 (let ((themes (string-append (site-packages inputs outputs)
1228 "/bpytop-themes")))
1229 (mkdir-p themes)
1230 (copy-recursively "themes" themes)))))))
1231 (inputs
1232 (list python-psutil))
1233 (native-inputs
1234 (list python-poetry-core))
1235 (home-page "https://github.com/aristocratos/bpytop")
1236 (synopsis "Resource monitor")
1237 (description "Resource monitor that shows usage and stats for processor,
1238memory, disks, network and processes. It's a Python port and continuation of
1239@command{bashtop}.")
1240 (license license:asl2.0)))
1241
1242(define-public pies
1243 (package
1244 (name "pies")
1245 (version "1.8")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri (string-append "mirror://gnu/pies/pies-"
1250 version ".tar.bz2"))
1251 (sha256
1252 (base32
1253 "0v0xcq0mfil440xq2pa5mjkyva5c9ahqda54z5w2ksl2d78v8a35"))
1254 (snippet
1255 #~(begin
1256 (use-modules (guix build utils))
1257 (for-each delete-file
1258 (append
1259 ;; Generated by flex.
1260 (find-files "gres/src" "lex\\.c$")
1261 ;; Generated by bison.
1262 (find-files "gres/src" "-gram\\.[ch]$")))))))
1263 (build-system gnu-build-system)
1264 (arguments
1265 '(#:phases (modify-phases %standard-phases
1266 (add-before 'build 'patch-/bin/sh
1267 (lambda* (#:key inputs #:allow-other-keys)
1268 ;; Use the right shell when executing user-provided
1269 ;; shell commands.
1270 (let ((bash (assoc-ref inputs "bash")))
1271 (substitute* '("src/progman.c" "src/comp.c")
1272 (("\"/bin/sh\"")
1273 (string-append "\"" bash "/bin/sh\"")))))))))
1274 (native-inputs (list bison flex))
1275 (inputs (list libxcrypt))
1276 (home-page "https://www.gnu.org.ua/software/pies/")
1277 (synopsis "Program invocation and execution supervisor")
1278 (description
1279 "GNU pies is a program that supervises the invocation and execution of
1280other programs. It reads the list of programs to be started from its
1281configuration file, executes them, and then monitors their status,
1282re-executing them as necessary.")
1283 (license license:gpl3+)))
1284
1285(define-public inetutils
1286 (package
1287 (name "inetutils")
1288 (version "2.8")
1289 (source (origin
1290 (method url-fetch)
1291 (uri (string-append "mirror://gnu/inetutils/inetutils-"
1292 version ".tar.gz"))
1293 (sha256
1294 (base32
1295 "1dchhf9lapsv63a0x9j2cg2s4nmhcfda18jv3s494namfx7wzcsp"))))
1296 (build-system gnu-build-system)
1297 (arguments
1298 (list
1299 #:configure-flags
1300 #~(list "--localstatedir=/var"
1301 "--sysconfdir=/etc"
1302 #$@(if (%current-target-system)
1303 '((string-append "--with-path-cp="
1304 (search-input-file %build-target-inputs
1305 "bin/cp"))
1306 (string-append "--with-path-login="
1307 (search-input-file %build-target-inputs
1308 "bin/login")))
1309 '())
1310 ;; Make sure 'PATH_PROCNET_DEV' gets defined when
1311 ;; cross-compiling (by default it does not.)
1312 #$@(if (and (%current-target-system)
1313 (not (target-hurd?)))
1314 '("--with-path-procnet-dev=/proc/net/dev")
1315 '())
1316 #$@(if (target-hurd?)
1317 '("--with-path-klog=/dev/klog")
1318 '()))
1319 ;; On some systems, 'libls.sh' may fail with an error such as:
1320 ;; "Failed to tell switch -a apart from -A".
1321 #:parallel-tests? #f))
1322 (inputs
1323 (list coreutils
1324 shadow ;for login (used in telnetd and rlogind)
1325 libxcrypt
1326 ncurses
1327 readline)) ;for 'ftp'
1328 (native-inputs
1329 (if (member (%current-system)
1330 (package-supported-systems net-tools))
1331 (list net-tools) ;for tests
1332 '()))
1333 (home-page "https://www.gnu.org/software/inetutils/")
1334 (synopsis "Basic networking utilities")
1335 (description
1336 "Inetutils is a collection of common network programs, such as an ftp
1337client and server, a telnet client and server, an rsh client and server, and
1338hostname.")
1339 (license license:gpl3+)))
1340
1341(define-public shadow
1342 (package
1343 (name "shadow")
1344 (version "4.19.0")
1345 (source (origin
1346 (method url-fetch)
1347 (uri (string-append
1348 "https://github.com/shadow-maint/shadow/releases/"
1349 "download/" version "/shadow-" version ".tar.xz"))
1350 (sha256
1351 (base32
1352 "0crbcfdp7ayyii33srinwd0yr27dkx9mbzglx1d0mvhr1z28xclw"))))
1353 (build-system gnu-build-system)
1354 (arguments
1355 `(;; Assume System V `setpgrp (void)', which is the default on GNU
1356 ;; variants (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
1357 #:configure-flags
1358 '(,@(if (target-hurd?)
1359 '()
1360 '("--with-libpam"))
1361 "--disable-logind" ;; no systemd
1362 "--without-libbsd" ;; no libbsd
1363 "shadow_cv_logdir=/var/log"
1364 "ac_cv_func_setpgrp_void=yes")
1365 #:phases
1366 (modify-phases %standard-phases
1367 (add-after 'unpack 'fix-linking-to-pam
1368 (lambda _
1369 ;; There's a build system problem in 4.9 that causes link
1370 ;; failures with the pam libraries (see:
1371 ;; https://github.com/shadow-maint/shadow/issues/407).
1372 (substitute* "libsubid/Makefile.in"
1373 (("\\$\\(LIBTCB\\)" all)
1374 (string-append all " $(LIBPAM)")))))
1375 ,@(if (%current-target-system)
1376 '((add-before 'configure 'set-runtime-shell
1377 (lambda* (#:key inputs #:allow-other-keys)
1378 (let ((shell (search-input-file inputs "/bin/bash")))
1379 (setenv "RUNTIME_SHELL" shell)
1380 (substitute* "configure.ac"
1381 (("\\$SHELL")
1382 "$RUNTIME_SHELL"))))))
1383 '())
1384 (add-before 'build 'set-nscd-file-name
1385 (lambda* (#:key inputs #:allow-other-keys)
1386 ;; Use the right file name for nscd.
1387 (let ((libc (assoc-ref inputs
1388 ,(if (%current-target-system)
1389 "cross-libc"
1390 "libc"))))
1391 (substitute* "lib/nscd.c"
1392 (("/usr/sbin/nscd")
1393 (string-append libc "/sbin/nscd"))))))
1394 (add-after 'install 'install-man-pages
1395 (lambda _
1396 ;; The top-level Makefile.am wrongfully has "SUBDIRS += man"
1397 ;; under "if ENABLE_REGENERATE_MAN", even though prebuilt man
1398 ;; pages are available. Thus, install them manually.
1399 (invoke "make" "-C" "man" "install"))))))
1400 (native-inputs (list pkg-config))
1401 (inputs
1402 (append (if (target-hurd?)
1403 '()
1404 (list linux-pam))
1405 (if (%current-target-system)
1406 (list bash-minimal)
1407 '())
1408 (list libxcrypt)))
1409 (home-page "https://github.com/shadow-maint/shadow")
1410 (synopsis "Authentication-related tools such as passwd, su, and login")
1411 (description
1412 "Shadow provides a number of authentication-related tools, including:
1413login, passwd, su, groupadd, and useradd.")
1414
1415 ;; The `vipw' program is GPLv2+.
1416 ;; libmisc/salt.c is public domain.
1417 (license license:bsd-3)))
1418
1419(define-public mingetty
1420 (package
1421 (name "mingetty")
1422 (version "1.08")
1423 (source (origin
1424 (method url-fetch)
1425 (uri (string-append "mirror://sourceforge/mingetty/mingetty/"
1426 version "/mingetty-" version ".tar.gz"))
1427 (sha256
1428 (base32
1429 "05yxrp44ky2kg6qknk1ih0kvwkgbn9fbz77r3vci7agslh5wjm8g"))))
1430 (build-system gnu-build-system)
1431 (arguments
1432 (list
1433 #:tests? #f ; no tests
1434 #:phases
1435 #~(modify-phases %standard-phases
1436 (replace 'configure
1437 (lambda* (#:key inputs #:allow-other-keys)
1438 (let* ((man8 (string-append #$output "/share/man/man8"))
1439 (sbin (string-append #$output "/sbin"))
1440 (login (search-input-file inputs "/bin/login")))
1441 (substitute* "Makefile"
1442 (("CC=.*$")
1443 (string-append "CC=" #$(cc-for-target) "\n"))
1444 (("^SBINDIR.*")
1445 (string-append "SBINDIR = " #$output "/sbin\n"))
1446 (("^MANDIR.*")
1447 (string-append "MANDIR = " #$output "/share/man/man8\n")))
1448
1449 ;; Pick the right 'login' by default.
1450 (substitute* "mingetty.c"
1451 (("\"/bin/login\"")
1452 (string-append "\"" login "\"")))
1453
1454 (mkdir-p sbin)
1455 (mkdir-p man8)))))))
1456 (inputs (list shadow))
1457 (home-page "https://sourceforge.net/projects/mingetty")
1458 (synopsis "Getty for the text console")
1459 (description
1460 "Small console getty that is started on the Linux text console,
1461asks for a login name and then transfers over to @code{login}. It is extended
1462to allow automatic login and starting any app.")
1463 (license license:gpl2+)))
1464
1465(define-public net-base
1466 (package
1467 (name "net-base")
1468 (version "5.3")
1469 (source (origin
1470 (method url-fetch)
1471 (uri (string-append
1472 "mirror://debian/pool/main/n/netbase/netbase_"
1473 version ".tar.xz"))
1474 (sha256
1475 (base32
1476 "12xqjwg3p4rzmmh2iib6sigm9l29y3dgk74mmnw64k84jnbwdxl1"))))
1477 (build-system trivial-build-system)
1478 (arguments
1479 `(#:modules ((guix build utils))
1480 ;; This package consists solely of architecture-independent
1481 ;; tables. Cross-compilation is pointless! Make sure we'll
1482 ;; always get the same derivation.
1483 #:target #f
1484 #:allowed-references ()
1485 #:builder (begin
1486 (use-modules (guix build utils)
1487 (srfi srfi-26))
1488
1489 (let* ((source (assoc-ref %build-inputs "source"))
1490 (tar (assoc-ref %build-inputs "tar"))
1491 (xz (assoc-ref %build-inputs "xz"))
1492 (output (assoc-ref %outputs "out"))
1493 (etc (string-append output "/etc")))
1494 (setenv "PATH" (string-append xz "/bin"))
1495 (invoke (string-append tar "/bin/tar") "xvf"
1496 source)
1497 (chdir ,(string-append "netbase-" version))
1498 (mkdir-p etc)
1499 (for-each copy-file
1500 '("etc-services" "etc-protocols" "etc-rpc")
1501 (map (cut string-append etc "/" <>)
1502 '("services" "protocols" "rpc")))
1503 #t))))
1504 (native-inputs (list tar xz))
1505 (synopsis "IANA protocol, port, and RPC number assignments")
1506 (description
1507 "This package provides the /etc/services, /etc/protocols, and /etc/rpc
1508files, which contain information about the IANA-assigned port, protocol, and
1509ONC RPC numbers.")
1510 (home-page "https://packages.debian.org/sid/netbase")
1511 (license license:gpl2)))
1512
1513(define-public netcat
1514 (package
1515 (name "netcat")
1516 (version "0.7.1")
1517 (source (origin
1518 (method url-fetch)
1519 (uri (string-append "mirror://sourceforge/netcat/netcat/" version
1520 "/netcat-" version ".tar.bz2"))
1521 (sha256
1522 (base32
1523 "1frjcdkhkpzk0f84hx6hmw5l0ynpmji8vcbaxg8h5k2svyxz0nmm"))))
1524 (build-system gnu-build-system)
1525 (arguments
1526 `(#:configure-flags
1527 ;; By default, man and info pages are put in PREFIX/{man,info},
1528 ;; but we want them in PREFIX/share/{man,info}.
1529 (let ((out (assoc-ref %outputs "out")))
1530 (list (string-append "--mandir=" out "/share/man")
1531 (string-append "--infodir=" out "/share/info")))))
1532 (home-page "https://netcat.sourceforge.net")
1533 (synopsis "Read and write data over TCP/IP")
1534 (description
1535 "Netcat is a featured networking utility which reads and writes data
1536across network connections, using the TCP/IP protocol. It is designed to be a
1537reliable \"back-end\" tool that can be used directly or easily driven by other
1538programs and scripts. At the same time, it is a feature-rich network debugging
1539and exploration tool, since it can create almost any kind of connection you
1540would need and has several interesting built-in capabilities.")
1541 (license license:gpl2+)))
1542
1543(define-public netcat-openbsd
1544 (package
1545 (name "netcat-openbsd")
1546 (version "1.219-1")
1547 (source (origin
1548 (method git-fetch)
1549 (uri (git-reference
1550 (url "https://salsa.debian.org/debian/netcat-openbsd.git")
1551 (commit (string-append "debian/" version))))
1552 (file-name (git-file-name name version))
1553 (sha256
1554 (base32
1555 "1fhrmnbdl6bgsjk02vi78zy9i486mmniymbbbhdkzl8zfjbjkpxc"))))
1556 (build-system gnu-build-system)
1557 (arguments
1558 `(#:tests? #f ; no test suite
1559 #:make-flags
1560 (list (string-append "CC=" ,(cc-for-target)))
1561 #:phases
1562 (modify-phases %standard-phases
1563 (delete 'configure)
1564 (add-before 'build 'patch
1565 (lambda _
1566 (setenv "QUILT_PATCHES" "debian/patches")
1567 (invoke "quilt" "push" "-a")))
1568 (replace 'install
1569 (lambda* (#:key outputs #:allow-other-keys)
1570 (let* ((out (assoc-ref outputs "out"))
1571 (bin (string-append out "/bin"))
1572 (man (string-append out "/share/man/man1"))
1573 (doc (string-append out "/share/doc/netcat-openbsd-" ,version))
1574 (examples (string-append doc "/examples")))
1575 (install-file "nc" bin)
1576 (install-file "nc.1" man)
1577 (install-file "debian/copyright" doc)
1578 (copy-recursively "debian/examples" examples)))))))
1579 (inputs (list libbsd))
1580 (native-inputs (list pkg-config quilt))
1581 (home-page "https://packages.debian.org/sid/netcat-openbsd")
1582 (synopsis "Read and write data over TCP/IP")
1583 (description
1584 "Netcat is a simple Unix utility which reads and writes data across
1585network connections using TCP or UDP protocol. It is designed to be a reliable
1586\"back-end\" tool that can be used directly or easily driven by other programs
1587and scripts. At the same time it is a feature-rich network debugging and
1588exploration tool, since it can create almost any kind of connection you would
1589need and has several interesting built-in capabilities.
1590
1591This package contains the OpenBSD rewrite of netcat, including support for
1592IPv6, proxies, and Unix sockets.")
1593 (license (list license:bsd-3
1594 license:bsd-2)))) ; atomicio.*, socks.c
1595
1596(define-public nmon
1597 (package
1598 (name "nmon")
1599 (version "16p")
1600 (source
1601 (origin
1602 (method url-fetch)
1603 (uri (string-append "mirror://sourceforge/nmon/lmon" version ".c"))
1604 (sha256
1605 (base32 "0akbkv70zffdmc5p51r02rlxd8b3jvkgl64rjsd29qr5cxgh9ijx"))))
1606 (build-system gnu-build-system)
1607 (arguments
1608 (list #:tests? #f ; no test suite
1609 #:phases
1610 #~(modify-phases %standard-phases
1611 (replace 'unpack
1612 (lambda _
1613 (copy-file #$(package-source this-package) "lmon.c")))
1614 (delete 'configure) ; no build system
1615 (replace 'build
1616 ;; There is an example ‘Makefile’ in the .c file.
1617 (lambda _
1618 ;; These #defines aren't well-documented and, e.g., POWER was
1619 ;; not actually tested on every possible TARGET-POWERPC?.
1620 (let* ((system #$(cond ((target-x86?) "X86")
1621 ((target-arm?) "ARM")
1622 ((target-powerpc?) "POWER")
1623 (else "CROSS_FINGERS"))))
1624 (format #t "Building for ~a~%" system)
1625 (invoke #$(cc-for-target) "-o" "nmon" "lmon.c"
1626 "-g" "-Wall" "-D" system
1627 "-lncurses" "-lm"))))
1628 (replace 'install
1629 (lambda _
1630 (let ((bin (string-append #$output "/bin"))
1631 (man1 (string-append #$output "/share/man/man1")))
1632 (install-file "nmon" bin)
1633 (mkdir-p man1)
1634 (copy-file #$(this-package-native-input "man-page")
1635 (string-append man1 "/nmon.1"))))))))
1636 (native-inputs
1637 (list `("man-page"
1638 ,(origin
1639 ;; There is no man page upstream, so install Debian's.
1640 (method url-fetch)
1641 (uri (string-append "https://salsa.debian.org/carnil/nmon/"
1642 "-/raw/debian/" version "+debian-1/"
1643 "debian/nmon.1"))
1644 (sha256
1645 (base32
1646 "1gpvd2kjyhs18sh6sga5bk9wj8s78blfd4c0m38r0wl92jx2yv1b"))))))
1647 (inputs
1648 (list ncurses))
1649 (home-page "https://nmon.sourceforge.net/")
1650 (synopsis
1651 "Monitor system performance in a terminal or to a @file{.csv} log file")
1652 (description
1653 "@acronym{Nmon, Nigel's performance monitor} is yet another system monitor
1654useful in systems administration, debugging, tuning, and benchmarking.
1655
1656The configurable ncurses interface displays all the classic resource usage
1657statistics (CPU, memory, network, disk, ...) as real-time graphs or numbers.
1658It can also list the processes responsible in a @command{top}-like table.
1659
1660A less common nmon feature is its ability to create highly detailed log files
1661in @acronym{CSV, comma-separated values} format. These can be imported into
1662spreadsheets or fed straight into an @acronym{RRD, round-robin database} using
1663@command{rrdtool} for further analysis, or to create colourful graphs.")
1664 (license license:gpl3+)))
1665
1666(define-public sipcalc
1667 (package
1668 (name "sipcalc")
1669 (version "1.1.6")
1670 (source
1671 (origin
1672 (method url-fetch)
1673 (uri (string-append "http://www.routemeister.net/projects"
1674 "/sipcalc/files/sipcalc" "-" version ".tar.gz"))
1675 (sha256
1676 (base32
1677 "0mv3wndj4z2bsshh2k8d5sy3j8wxzgf8mzmmkvj1k8gpcz37dm6g"))))
1678 (build-system gnu-build-system)
1679 (home-page "https://www.routemeister.net/projects/sipcalc/")
1680 (synopsis "Command-line IP subnet calculator")
1681 (description
1682 "Sipcalc is an advanced command-line IP subnet calculator. It can take
1683multiple forms of input (IPv4/IPv6/interface/hostname) and output a multitude
1684of information about a given subnet.
1685
1686Features include:
1687
1688@itemize @bullet
1689@item IPv4
1690@itemize
1691@item Retrieving of address information from interfaces.
1692@item Classfull and CIDR output.
1693@item Multiple address and netmask input and output formats (dotted quad, hex,
1694number of bits).
1695@item Output of broadcast address, network class, Cisco wildcard,
1696hosts/range, network range.
1697@item The ability to split a network based on a smaller netmask, now also with
1698recursive runs on the generated subnets. (also IPv6)
1699@end itemize
1700@item IPv6
1701@itemize
1702@item Compressed and expanded input and output addresses.
1703@item Standard IPv6 network output.
1704@item v4 in v6 output.
1705@item Reverse DNS address generation.
1706@end itemize
1707@end itemize\n")
1708 (license license:bsd-3)))
1709
1710(define-public prips
1711 (package
1712 (name "prips")
1713 (version "1.2.2")
1714 (source
1715 (origin
1716 (method url-fetch)
1717 (uri (string-append "https://devel.ringlet.net/files/sys/"
1718 name "/" name "-" version ".tar.xz"))
1719 (sha256
1720 (base32 "1cm0hmd4wz5k683fqa6a2f9m2ky8j8q0kdrknrl9y3ga36x11mzr"))))
1721 (build-system gnu-build-system)
1722 (arguments
1723 (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
1724 #:test-target "test"
1725 #:phases #~(modify-phases %standard-phases
1726 (delete 'configure)
1727 (replace 'install
1728 (lambda _
1729 (install-file "prips"
1730 (string-append #$output "/bin")))))))
1731 (native-inputs (list perl-test-harness))
1732 (synopsis "Tool that prints the IP addresses in a given range")
1733 (description "Prips can be used to print all of the IP addresses in
1734 a given range. This allows the enhancement of tools only work
1735 on one host at a time (e.g. whois).")
1736 (home-page "https://devel.ringlet.net/sysutils/prips/")
1737 (license license:gpl2+)))
1738
1739(define-public alive
1740 (package
1741 (name "alive")
1742 (version "2.0.5")
1743 (source (origin
1744 (method url-fetch)
1745 (uri (string-append "mirror://gnu/alive/alive-"
1746 version ".tar.lz"))
1747 (sha256
1748 (base32
1749 "12ahlxbbrynm6md8qc872qr795lqpfkr8kwlsig40i4nznzkvkwl"))))
1750 (build-system gnu-build-system)
1751 (arguments '(#:configure-flags '("alive_cv_nice_ping=yes")))
1752 (inputs
1753 (list guile-3.0
1754 inetutils))
1755 (native-inputs
1756 (list lzip))
1757 (home-page "https://www.gnu.org/software/alive/")
1758 (synopsis "Autologin and keep-alive daemon")
1759 (description
1760 "GNU Alive sends periodic pings to a server, generally to keep a
1761connection alive.")
1762 (license license:gpl3+)))
1763
1764(define-public isc-dhcp
1765 (let* ((bind-major-version "9")
1766 (bind-minor-version "11")
1767 (bind-patch-version "37")
1768 (bind-release-type "") ; for patch release, use "-P"
1769 (bind-release-version "") ; for patch release, e.g. "6"
1770 (bind-version (string-append bind-major-version
1771 "."
1772 bind-minor-version
1773 "."
1774 bind-patch-version
1775 bind-release-type
1776 bind-release-version)))
1777 (package
1778 (name "isc-dhcp")
1779 (version "4.4.3-P1")
1780 (source (origin
1781 (method url-fetch)
1782 (uri (string-append "https://ftp.isc.org/isc/dhcp/"
1783 version "/dhcp-" version ".tar.gz"))
1784 (sha256
1785 (base32
1786 "1ivkvhhvqxap6c51cli7pa6xn76ngxri1zbl45ishz4ranxidi0a"))
1787 (patches (search-patches
1788 "dhclient-script-resolvconf-support.patch"))))
1789 (build-system gnu-build-system)
1790 (arguments
1791 `(#:parallel-build? #f
1792 #:configure-flags '("--with-randomdev=/dev/random")
1793 #:phases
1794 (modify-phases %standard-phases
1795 (add-after 'unpack 'replace-bundled-bind
1796 (lambda* (#:key inputs native-inputs #:allow-other-keys)
1797 (delete-file "bind/bind.tar.gz")
1798 (copy-file (assoc-ref inputs "bind-source-tarball")
1799 "bind/bind.tar.gz")
1800 (chmod "bind/bind.tar.gz" #o644)
1801 (substitute* "bind/version.tmp"
1802 (("^MAJORVER=.*")
1803 (format #f "MAJORVER=~a\n" ,bind-major-version))
1804 (("^MINORVER=.*")
1805 (format #f "MINORVER=~a\n" ,bind-minor-version))
1806 (("^PATCHVER=.*")
1807 (format #f "PATCHVER=~a\n" ,bind-patch-version))
1808 (("^RELEASETYPE=.*")
1809 (format #f "RELEASETYPE=~a\n" ,bind-release-type))
1810 (("^RELEASEVER=.*")
1811 (format #f "RELEASEVER=~a\n" ,bind-release-version)))))
1812 ,@(if (%current-target-system)
1813 `((add-before 'configure 'fix-bind-cross-compilation
1814 (lambda _
1815 (substitute* "configure"
1816 (("--host=\\$host")
1817 "--host=$host_alias --build=$build_alias"))
1818 ;; BIND needs a native compiler because the DHCP
1819 ;; build system uses the built 'gen' executable.
1820 (setenv "BUILD_CC" "gcc")
1821 ;; powerpc-linux needs to be told to use -latomic.
1822 ,@(if (target-ppc32?)
1823 `((setenv "LIBS" "-latomic"))
1824 '()))))
1825 '())
1826 (add-before 'configure 'update-config-scripts
1827 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1828 (for-each (lambda (file)
1829 (install-file
1830 (search-input-file
1831 (or native-inputs inputs)
1832 (string-append "/bin/" file)) "."))
1833 '("config.guess" "config.sub"))))
1834 (add-before 'build 'update-config-scripts-for-bind
1835 (lambda* (#:key native-inputs inputs #:allow-other-keys)
1836 (for-each (lambda (file)
1837 (install-file
1838 (search-input-file
1839 (or native-inputs inputs)
1840 (string-append "/bin/" file))
1841 (string-append "bind/bind-" ,bind-version)))
1842 '("config.guess" "config.sub"))))
1843 (add-after 'configure 'post-configure
1844 (lambda* (#:key outputs #:allow-other-keys)
1845 ;; Point to the right client script, which will be
1846 ;; installed in a later phase.
1847 (substitute* "includes/dhcpd.h"
1848 (("#define[[:blank:]]+_PATH_DHCLIENT_SCRIPT.*")
1849 (let ((out (assoc-ref outputs "out")))
1850 (string-append "#define _PATH_DHCLIENT_SCRIPT \""
1851 out "/libexec/dhclient-script"
1852 "\"\n"))))
1853
1854 ;; During the 'build' phase, 'bind.tar.gz' is extracted, so
1855 ;; we must patch shebangs in there and make sure the right
1856 ;; shell is used.
1857 (with-directory-excursion "bind"
1858 (substitute* "Makefile"
1859 (("\\./configure ")
1860 (let ((sh (which "sh")))
1861 (string-append "./configure CONFIG_SHELL="
1862 sh " SHELL=" sh " "))))
1863
1864 (let ((bind-directory (string-append "bind-" ,bind-version)))
1865 (invoke "tar" "xf" "bind.tar.gz")
1866 (for-each patch-shebang
1867 (find-files bind-directory ".*"))
1868 (substitute* (string-append bind-directory "/configure")
1869 (("/usr/bin/file")
1870 (which "file")))
1871 (invoke "tar" "cf" "bind.tar.gz"
1872 bind-directory
1873 ;; avoid non-determinism in the archive
1874 "--sort=name"
1875 "--mtime=@0"
1876 "--owner=root:0"
1877 "--group=root:0")))))
1878 (add-after 'install 'post-install
1879 (lambda* (#:key inputs outputs #:allow-other-keys)
1880 ;; Install the dhclient script for GNU/Linux and make sure
1881 ;; if finds all the programs it needs.
1882 (let* ((out (assoc-ref outputs "out"))
1883 (libexec (string-append out "/libexec"))
1884 (coreutils (assoc-ref inputs "coreutils*"))
1885 (inetutils (assoc-ref inputs "inetutils"))
1886 (grep (assoc-ref inputs "grep*"))
1887 (resolvconf (assoc-ref inputs "resolvconf*"))
1888 (sed (assoc-ref inputs "sed*"))
1889 (debianutils (assoc-ref inputs "debianutils")))
1890 (substitute* "client/scripts/linux"
1891 (("/sbin/ip")
1892 (search-input-file inputs "/sbin/ip")))
1893
1894 (mkdir-p libexec)
1895 (copy-file "client/scripts/linux"
1896 (string-append libexec "/dhclient-script"))
1897
1898 (wrap-program
1899 (string-append libexec "/dhclient-script")
1900 `("PATH" ":" prefix
1901 ,(map (lambda (dir)
1902 (string-append dir "/bin:"
1903 dir "/sbin"))
1904 (list inetutils coreutils grep sed resolvconf
1905 debianutils))))))))))
1906
1907 (native-inputs
1908 (list config perl file))
1909
1910 (inputs `(("inetutils" ,inetutils)
1911 ("bash" ,bash-minimal)
1912 ,@(if (target-hurd?)
1913 '()
1914 `(("iproute" ,iproute)))
1915
1916 ;; dhclient-script provides hooks to users and uses run-parts in
1917 ;; order to list users defined hooks.
1918 ("debianutils" ,debianutils)
1919
1920 ;; isc-dhcp bundles a copy of BIND, which has proved vulnerable
1921 ;; in the past. Use a BIND-VERSION of our choosing instead.
1922 ("bind-source-tarball"
1923 ,(origin
1924 (method url-fetch)
1925 (uri (string-append "https://ftp.isc.org/isc/bind9/"
1926 bind-version
1927 "/bind-" bind-version ".tar.gz"))
1928 (sha256
1929 (base32
1930 "1zsszgxs9043dfpxb6xs1iwk9jg7nxkl5pbawj8dlshnxkkzp3hd"))))
1931
1932 ("coreutils*" ,coreutils)
1933 ("grep*" ,grep)
1934 ("resolvconf*" ,openresolv)
1935 ("sed*" ,sed)))
1936
1937 (home-page "https://www.isc.org/dhcp/")
1938 (synopsis "Dynamic Host Configuration Protocol (DHCP) tools")
1939 (description
1940 "ISC's Dynamic Host Configuration Protocol (DHCP) distribution provides a
1941reference implementation of all aspects of DHCP, through a suite of DHCP
1942tools: server, client, and relay agent.
1943
1944This software is @emph{end-of-life}! ISC does not intend to issue any further
1945maintenance releases.")
1946 (license license:mpl2.0)
1947 (properties '((cpe-name . "dhcp"))))))
1948
1949(define-public dhcpcd
1950 (package
1951 (name "dhcpcd")
1952 (version "10.5.0")
1953 (source
1954 (origin
1955 (method git-fetch)
1956 (uri (git-reference
1957 (url "https://github.com/NetworkConfiguration/dhcpcd")
1958 (commit (string-append "v" version))))
1959 (file-name (git-file-name name version))
1960 (sha256
1961 (base32 "1mdi4pm44pha47ivfn2gsf9w9rdpyw4q19x4myvkbifjg6lf7r4i"))))
1962 (build-system gnu-build-system)
1963 (arguments
1964 (list
1965 #:test-target "test"
1966 #:configure-flags #~(list "--enable-ipv6"
1967 "--enable-privsep"
1968 "--privsepuser=dhcpcd"
1969 (string-append "--dbdir=" "/var/db/dhcpcd")
1970 (string-append "--rundir=" "/var/run/dhcpcd")
1971 (string-append "CC=" #$(cc-for-target)))
1972 #:phases
1973 #~(modify-phases %standard-phases
1974 (add-after 'unpack 'do-not-create-dbdir
1975 (lambda _
1976 ;; Make sure that the Makefile doesn't attempt to create
1977 ;; /var/db/dhcpcd for which it doesn't have permissions.
1978 (substitute* "src/Makefile"
1979 (("\\$\\{INSTALL\\} -m \\$\\{DBMODE\\} -d\
1980 \\$\\{DESTDIR\\}\\$\\{DBDIR\\}")
1981 ""))))
1982 (add-before 'build 'setenv
1983 (lambda _
1984 (setenv "HOST_SH" (which "sh"))))
1985 (add-after 'install 'wrap-hooks
1986 (lambda* (#:key inputs outputs #:allow-other-keys)
1987 ;; It's important that the 'resolvconf' binary used be that of
1988 ;; openresolv, which is the one responsible for maintaining
1989 ;; /etc/resolv.conf in Guix.
1990 (let* ((resolvconf (search-input-file inputs "sbin/resolvconf"))
1991 (rm (search-input-file inputs "bin/rm"))
1992 (sed (search-input-file inputs "bin/sed")))
1993 (wrap-program (string-append
1994 #$output "/libexec/dhcpcd-run-hooks")
1995 (list "PATH" 'suffix
1996 (list (dirname resolvconf)
1997 (dirname rm)
1998 (dirname sed))))))))))
1999 (inputs (list bash-minimal coreutils-minimal eudev openresolv sed))
2000 (home-page "https://roy.marples.name/projects/dhcpcd")
2001 (synopsis "Feature-rich DHCP and DHCPv6 client")
2002 (description
2003 "Provides a DHCP and a DHCPv6 client. Additionally,
2004dhcpcd is also an IPv4LL (aka ZeroConf) client. In layperson's terms,
2005dhcpcd runs on your machine and silently configures your computer to work
2006on the attached networks without trouble and mostly without configuration.")
2007 (license license:bsd-2)))
2008
2009(define-public radvd
2010 (package
2011 (name "radvd")
2012 (version "2.21")
2013 (source
2014 (origin
2015 (method git-fetch)
2016 (uri (git-reference
2017 (url "https://github.com/radvd-project/radvd")
2018 (commit (string-append "v" version))))
2019 (file-name (git-file-name name version))
2020 (sha256
2021 (base32 "18f0qznd2bksxgsnb5wf4ddy1x90skyr10yfsivlw2i7kwn6hrnk"))))
2022 (build-system gnu-build-system)
2023 (native-inputs
2024 (list autoconf
2025 automake
2026 bison
2027 check
2028 flex
2029 pkg-config))
2030 (inputs (list libbsd))
2031 (arguments
2032 (if (%current-target-system)
2033 (list)
2034 (list #:configure-flags #~(list "--with-check"))))
2035 (home-page "https://radvd.litech.org/")
2036 (synopsis "IPv6 Router Advertisement Daemon")
2037 (description
2038 "The Router Advertisement Daemon (radvd) is run on systems acting as IPv6
2039routers. It sends Router Advertisement messages specified by RFC 2461
2040periodically and when requested by a node sending a Router Solicitation
2041message. These messages are required for IPv6 stateless autoconfiguration.")
2042 (license (license:non-copyleft "file://COPYRIGHT"))))
2043
2044(define-public ndppd
2045 (package
2046 (name "ndppd")
2047 (version "0.2.6")
2048 (source
2049 (origin
2050 (method git-fetch)
2051 (uri (git-reference
2052 (url "https://github.com/DanielAdolfsson/ndppd")
2053 (commit version)))
2054 (file-name (git-file-name name version))
2055 (sha256
2056 (base32 "1b0xda2cr4yq2pj8zch9gvfxqvz1n5rjl4nyqn70jyrincvsi8qn"))))
2057 (build-system gnu-build-system)
2058 (arguments
2059 (list #:tests? #f ; There are no tests
2060 #:make-flags #~(list (string-append "PREFIX=" #$output))
2061 #:phases
2062 #~(modify-phases %standard-phases
2063 (delete 'configure)
2064 (add-after 'unpack 'fix-paths
2065 (lambda _
2066 (substitute* "Makefile"
2067 (("/bin/gzip") "gzip")))))))
2068 (synopsis "NDP Proxy Daemon")
2069 (description
2070 "The Neighbor Discovery Protocol Proxy Daemon (ndppd) proxies some IPv6
2071NDP messages between interfaces to allow IPv6 routing between machines that
2072are in the same network but not on the same local link. It currently only
2073supports Neighbor Solicitation and Neighbor Advertisement messages.")
2074 (home-page "https://github.com/DanielAdolfsson/ndppd")
2075 (license license:gpl3+)))
2076
2077(define-public libpcap
2078 (package
2079 (name "libpcap")
2080 (version "1.10.1")
2081 (source (origin
2082 (method url-fetch)
2083 (uri (string-append "https://www.tcpdump.org/release/libpcap-"
2084 version ".tar.gz"))
2085 (sha256
2086 (base32
2087 "1m5x26vlbymp90k1qh0w3nj2nxzyvfrmfmwpj17k81dgri55ya7d"))))
2088 (build-system gnu-build-system)
2089 (native-inputs
2090 (list bison flex))
2091 (arguments
2092 ;; There are some tests in testprogs/, but no automated test suite.
2093 `(#:tests? #f
2094 #:phases
2095 (modify-phases %standard-phases
2096 (add-after 'unpack 'omit-static-library
2097 ;; Neither build nor install libpcap.a.
2098 (lambda _
2099 (substitute* "Makefile.in"
2100 ((" libpcap\\.a") "")
2101 ((" install-archive ") " ")))))))
2102 (home-page "https://www.tcpdump.org")
2103 (synopsis "Network packet capture library")
2104 (description
2105 "libpcap is an interface for user-level packet capture. It provides a
2106portable framework for low-level network monitoring. Applications include
2107network statistics collection, security monitoring, network debugging, etc.")
2108 (license (list license:bsd-4 ; fad-*.c and several other source files
2109 license:bsd-3 ; pcap/, sockutils.* & others
2110 license:bsd-2)))) ; the rest
2111
2112(define-public tcpdump
2113 (package
2114 (name "tcpdump")
2115 (version "4.99.4")
2116 (source (origin
2117 (method url-fetch)
2118 (uri (string-append "https://www.tcpdump.org/release/tcpdump-"
2119 version ".tar.gz"))
2120 (sha256
2121 (base32
2122 "1slzwjk5f8sygwxqci4vkbas0qqcgs5a0w3f8br6p7gjn8dj6ch2"))))
2123 (build-system gnu-build-system)
2124 (inputs (list libpcap openssl))
2125 (native-inputs (list perl)) ; for tests
2126 (home-page "https://www.tcpdump.org/")
2127 (synopsis "Network packet analyzer")
2128 (description
2129 "Tcpdump is a command-line tool to analyze network traffic passing
2130through the network interface controller.")
2131 (license license:bsd-3)))
2132
2133(define-public jnettop
2134 (package
2135 (name "jnettop")
2136 (version "0.13.0")
2137 (source (origin
2138 (method url-fetch)
2139 (uri
2140 (string-append "https://web.archive.org/web/20161221100811/"
2141 "http://jnettop.kubs.info/dist/jnettop-"
2142 version ".tar.gz"))
2143 (sha256
2144 (base32
2145 "1855np7c4b0bqzhf1l1dyzxb90fpnvrirdisajhci5am6als31z9"))))
2146 (build-system gnu-build-system)
2147 (arguments
2148 (list #:configure-flags
2149 #~'("CFLAGS=-O2 -g -Wno-implicit-function-declaration")))
2150 (native-inputs
2151 (list pkg-config))
2152 (inputs
2153 (list glib ncurses libpcap))
2154 (home-page
2155 "https://web.archive.org/web/20160703195221/http://jnettop.kubs.info/wiki/")
2156 (synopsis "Visualize network traffic by bandwidth use")
2157 (description
2158 "Jnettop is a traffic visualiser, which captures traffic going
2159through the host it is running from and displays streams sorted
2160by bandwidth they use.")
2161 (license license:gpl2+)))
2162
2163(define-public clusterssh
2164 (package
2165 (name "clusterssh")
2166 (version "4.13.2")
2167 (source (origin
2168 (method url-fetch)
2169 (uri (string-append "mirror://sourceforge/clusterssh/"
2170 "2.%20ClusterSSH%20Series%204/"
2171 "App-ClusterSSH-v" version ".tar.gz"))
2172 (sha256
2173 (base32
2174 "0rmk2p3f2wz1h092anidjclh212rv3gxyk0c641qk3frlrjnw6mp"))))
2175 (build-system perl-build-system)
2176 (arguments
2177 `(#:phases
2178 (modify-phases %standard-phases
2179 (add-after 'unpack 'refer-to-inputs
2180 (lambda* (#:key inputs #:allow-other-keys)
2181 (substitute* (list "lib/App/ClusterSSH/Config.pm"
2182 "t/15config.t")
2183 (("xterm")
2184 (which "xterm")))))
2185 (add-before 'check 'delete-failing-tests
2186 (lambda _
2187 ;; This checks whether all code is nicely formatted. The above
2188 ;; ‘refer-to-inputs’ phase breaks this pedantry, so disable it.
2189 (delete-file "t/perltidy.t")
2190 ;; Update the manifest so t/manifest.t happily passes.
2191 (substitute* "MANIFEST"
2192 (("t/perltidy.t\n") ""))))
2193 (add-after 'install 'augment-library-path
2194 (lambda* (#:key inputs outputs #:allow-other-keys)
2195 (let* ((out (assoc-ref outputs "out"))
2196 (bin (string-append out "/bin")))
2197 (with-directory-excursion bin
2198 (for-each
2199 (lambda (program)
2200 (wrap-program program
2201 `("PERL5LIB" ":" prefix
2202 ,(map (lambda (file-name)
2203 (string-append file-name
2204 "/lib/perl5/site_perl"))
2205 (cons out
2206 (map (lambda (input)
2207 (assoc-ref inputs input))
2208 ;; These may be propagated and hence
2209 ;; not explicitly listed as inputs.
2210 (list "perl-class-data-inheritable"
2211 "perl-devel-stacktrace"
2212 "perl-exception-class"
2213 "perl-tk"
2214 "perl-try-tiny"
2215 "perl-x11-protocol"
2216 "perl-x11-protocol-other")))))))
2217 (find-files "." ".*")))))))))
2218 (native-inputs
2219 (list perl-cpan-changes
2220 perl-file-slurp
2221 perl-file-which
2222 perl-module-build
2223 perl-readonly
2224 perl-test-differences
2225 perl-test-distmanifest
2226 perl-test-perltidy
2227 perl-test-pod
2228 perl-test-pod-coverage
2229 perl-test-trap
2230 perl-tidy))
2231 (inputs
2232 (list bash-minimal ;for wrap-program
2233 perl-exception-class
2234 perl-sort-naturally
2235 perl-tk
2236 perl-try-tiny
2237 perl-x11-protocol
2238 perl-x11-protocol-other
2239 xterm))
2240 ;; The clusterssh.sourceforge.net address requires login to view
2241 (home-page "https://sourceforge.net/projects/clusterssh/")
2242 (synopsis "Secure concurrent multi-server terminal control")
2243 (description
2244 "ClusterSSH controls a number of xterm windows via a single graphical
2245console window to allow commands to be interactively run on multiple servers
2246over ssh connections.")
2247 (license license:gpl2+)))
2248
2249(define-public realmd
2250 (package
2251 (name "realmd")
2252 (version "0.17.1")
2253 (source
2254 (origin
2255 (method git-fetch)
2256 (uri (git-reference
2257 (url "https://github.com/freedesktop/realmd")
2258 (commit version)))
2259 (file-name (git-file-name name version))
2260 (sha256
2261 (base32 "063cf4jkpfj548a7dxmffrpbh3j413nq3zy1zzj20lcfffnnaqwn"))))
2262 (build-system gnu-build-system)
2263 (arguments
2264 `(#:configure-flags '("--with-systemd-unit-dir=no"
2265 "--with-systemd-journal=no"
2266 "--with-distro=GNU guix"
2267 "--disable-doc")
2268 #:phases
2269 (modify-phases %standard-phases
2270 (add-before 'install 'fix-service
2271 (lambda* (#:key outputs #:allow-other-keys)
2272 ;; GNU Guix does not have service config file, therefore we remove
2273 ;; the line that copies the file.
2274 (substitute* "Makefile"
2275 ((".*/service/realmd-.*") "")))))))
2276 (native-inputs
2277 (list autoconf
2278 automake
2279 `(,glib "bin")
2280 intltool
2281 pkg-config
2282 python))
2283 (inputs
2284 (list glib mit-krb5 openldap polkit))
2285 (synopsis "DBus service for network authentication")
2286 (description "This package provides an on demand system DBus service.
2287It allows callers to configure network authentication and domain membership
2288in a standard way. Realmd discovers information about the domain or realm
2289automatically and does not require complicated configuration in order to join
2290a domain or realm. Dbus system service that manages discovery and enrollment in
2291realms/domains like Active Directory or IPA.")
2292 (home-page "https://www.freedesktop.org/software/realmd/")
2293 (license license:lgpl2.1+)))
2294
2295(define-public rename
2296 (package
2297 (name "rename")
2298 (version "2.02")
2299 (source (origin
2300 (method url-fetch)
2301 (uri (string-append
2302 "mirror://cpan/authors/id/R/RM/RMBARKER/File-Rename-"
2303 version ".tar.gz"))
2304 (sha256
2305 (base32
2306 "1pr0qmsb9gb5xqwpicabnr5jcxdbbvz1mgdqw3d3d0dn12060ysk"))))
2307 (build-system perl-build-system)
2308 (arguments
2309 `(#:phases
2310 (modify-phases %standard-phases
2311 (add-after 'install 'find-itself
2312 ;; Fix run-time 'Can't locate File/Rename.pm in @INC' failure.
2313 (lambda* (#:key outputs #:allow-other-keys)
2314 (let* ((out (assoc-ref outputs "out"))
2315 (bin (string-append out "/bin")))
2316 (with-directory-excursion bin
2317 (for-each
2318 (lambda (program)
2319 (wrap-program program
2320 `("PERL5LIB" ":" prefix
2321 (,(string-append out "/lib/perl5/site_perl")))))
2322 (find-files "." ".*")))))))))
2323 (native-inputs
2324 (list perl-module-build perl-test-pod perl-test-pod-coverage))
2325 (inputs (list bash-minimal)) ;for wrap-program
2326 (home-page "https://metacpan.org/pod/distribution/File-Rename/rename.PL")
2327 (synopsis "Perl extension for renaming multiple files")
2328 (description
2329 "This package provides a Perl interface (@code{Perl::Rename}) as well
2330as a command-line utility (@command{rename}) that can rename multiple files
2331at once based on a Perl regular expression.")
2332 (license license:perl-license)))
2333
2334(define-public rottlog
2335 (package
2336 (name "rottlog")
2337 (version "0.72.2")
2338 (source (origin
2339 (method url-fetch)
2340 (uri (string-append "mirror://gnu/rottlog/rottlog-"
2341 version ".tar.gz"))
2342 (sha256
2343 (base32
2344 "0751mb9l2f0jrk3vj6q8ilanifd121dliwk0c34g8k0dlzsv3kd7"))
2345 (modules '((guix build utils)))
2346 (patches (search-patches "rottlog-direntry.patch"))
2347 (snippet
2348 '(begin
2349 ;; Delete outdated Autotools build system files.
2350 (for-each delete-file
2351 (list "Makefile.in"
2352 "config.guess"
2353 "config.sub"
2354 "configure"
2355 "depcomp"
2356 "install-sh"
2357 "mdate-sh"
2358 "missing"
2359 "mkinstalldirs"
2360 "texinfo.tex"))
2361 (substitute* "Makefile.am"
2362 (("mkdir -p \\$\\(ROTT_STATDIR\\)")
2363 ;; Don't attempt to create /var/lib/rottlog.
2364 "true"))))))
2365 (build-system gnu-build-system)
2366 (arguments
2367 (list
2368 #:configure-flags #~(list "ROTT_ETCDIR=/etc/rottlog" ;rc file location
2369 "--localstatedir=/var")
2370 ;; Install example config files in OUT/etc.
2371 #:make-flags #~(list (string-append "ROTT_ETCDIR=" #$output "/etc")
2372 ;; Avoid the default -o root -g root arguments,
2373 ;; which fail due to not running as root.
2374 "INSTALL_RC=install"
2375 "INSTALL_SCRIPT=install")
2376 #:phases
2377 #~(modify-phases %standard-phases
2378 (add-after 'unpack 'patch-paths
2379 (lambda* (#:key inputs #:allow-other-keys)
2380 (substitute* "rc/rc"
2381 (("/usr/sbin/sendmail")
2382 (search-input-file inputs "/bin/mail")))
2383 (with-fluids ((%default-port-encoding "ISO-8859-1"))
2384 (substitute* "src/rottlog"
2385 (("awk")
2386 (search-input-file inputs "/bin/awk"))))))
2387 (add-after 'build 'set-packdir
2388 (lambda _
2389 ;; Set a default location for archived logs.
2390 (substitute* "rc/rc"
2391 (("packdir=\"\"")
2392 "packdir=\"/var/log\""))))
2393 (add-before 'install 'tweak-rc-weekly
2394 (lambda* (#:key inputs #:allow-other-keys)
2395 (substitute* "rc/weekly"
2396 (("/bin/kill")
2397 (search-input-file inputs "/bin/kill"))
2398 (("syslogd\\.pid")
2399 ;; The file is called 'syslog.pid' (no 'd').
2400 "syslog.pid"))))
2401 (add-after 'install 'install-info
2402 (lambda _
2403 (invoke "make" "install-info"))))))
2404 (native-inputs (list autoconf automake texinfo util-linux)) ; for 'cal'
2405 (inputs (list coreutils gawk mailutils))
2406 (home-page "https://www.gnu.org/software/rottlog/")
2407 (synopsis "Log rotation and management")
2408 (description
2409 "GNU Rot[t]log is a program for managing log files. It is used to
2410automatically rotate out log files when they have reached a given size or
2411according to a given schedule. It can also be used to automatically compress
2412and archive such logs. Rot[t]log will mail reports of its activity to the
2413system administrator.")
2414 (license license:gpl3+)))
2415
2416(define-public sudo
2417 (package
2418 (name "sudo")
2419 (version "1.9.17p1")
2420 (source (origin
2421 (method url-fetch)
2422 (uri
2423 (list (string-append "https://www.sudo.ws/sudo/dist/sudo-"
2424 version ".tar.gz")
2425 (string-append "ftp://ftp.sudo.ws/pub/sudo/OLD/sudo-"
2426 version ".tar.gz")))
2427 (sha256
2428 (base32
2429 "0cjx8lkwlqz03psnaia07rz9mpyn5ilpixvqi9rrf8872ykpwq7z"))
2430 (modules '((guix build utils)))
2431 (snippet
2432 '(begin
2433 (delete-file-recursively "lib/zlib")))))
2434 (build-system gnu-build-system)
2435 (outputs (list "out"))
2436 (arguments
2437 (list #:configure-flags
2438 #~(list (string-append "--docdir=" #$output
2439 "/share/doc/" #$name "-" #$version)
2440
2441 "--with-logpath=/var/log/sudo.log"
2442 "--with-rundir=/var/run/sudo" ; must be cleaned up at boot time
2443 "--with-vardir=/var/db/sudo"
2444 "--with-iologdir=/var/log/sudo-io"
2445 "--with-sendmail=/run/privileged/bin/sendmail"
2446
2447 ;; 'visudo.c' expects _PATH_MV to be defined, but glibc doesn't
2448 ;; provide it.
2449 (string-append "CPPFLAGS=-D_PATH_MV=\\\""
2450 (search-input-file %build-inputs "/bin/mv")
2451 "\\\"")
2452
2453 ;; When cross-compiling, assume we have a working 'snprintf' and
2454 ;; 'vsnprintf' (which we do, when using glibc). The default
2455 ;; choice fails with undefined references to 'sudo_snprintf' &
2456 ;; co. when linking.
2457 #$@(if (%current-target-system)
2458 '("ac_cv_have_working_snprintf=yes"
2459 "ac_cv_have_working_vsnprintf=yes")
2460 '()))
2461
2462 ;; Avoid non-determinism; see <http://bugs.gnu.org/21918>.
2463 #:parallel-build? #f
2464
2465 #:phases
2466 #~(modify-phases %standard-phases
2467 (add-before 'configure 'pre-configure
2468 (lambda _
2469 (substitute* "src/sudo_usage.h.in"
2470 ;; Do not capture 'configure' arguments since we would
2471 ;; unduly retain references, and also because the
2472 ;; CPPFLAGS above would close the string literal
2473 ;; prematurely.
2474 (("@CONFIGURE_ARGS@")
2475 "\"\""))
2476 (substitute* (find-files "." "Makefile\\.in")
2477 ;; Allow installation as non-root.
2478 (("-o [[:graph:]]+ -g [[:graph:]]+")
2479 "")
2480 ;; Don't try to create /etc/sudoers.
2481 (("^install: (.*)install-sudoers(.*)" _ before
2482 after)
2483 (string-append "install: " before after "\n"))
2484 ;; Don't try to create /run/sudo.
2485 (("\\$\\(DESTDIR\\)\\$\\(rundir\\)")
2486 "$(TMPDIR)/dummy")
2487 ;; Install example sudo{,_logsrvd}.conf to the right place.
2488 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)")
2489 "$(DESTDIR)/$(docdir)/examples")
2490 ;; Don't try to create /var/db/sudo.
2491 (("\\$\\(DESTDIR\\)\\$\\(vardir\\)")
2492 "$(TMPDIR)/dummy"))
2493
2494 ;; ‘Checking existing [/etc/]sudoers file for syntax errors’ is
2495 ;; not the task of the build system, and fails.
2496 (substitute* "plugins/sudoers/Makefile.in"
2497 (("^pre-install:" match)
2498 (string-append match "\ndisabled-" match))))))
2499
2500 ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
2501 ;; the chroot's /etc/passwd doesn't have it. Turn off the tests.
2502 #:tests? #f))
2503 (native-inputs
2504 (list groff))
2505 (inputs
2506 (append (list coreutils zlib)
2507 (if (target-hurd?)
2508 (list libxcrypt)
2509 (list linux-pam))))
2510 (home-page "https://www.sudo.ws/")
2511 (synopsis "Run commands as root")
2512 (description
2513 "Sudo (su \"do\") allows a system administrator to delegate authority to
2514give certain users (or groups of users) the ability to run some (or all)
2515commands as root or another user while providing an audit trail of the
2516commands and their arguments.")
2517
2518 ;; See <http://www.sudo.ws/sudo/license.html>.
2519 (license license:x11)))
2520
2521(define-public opendoas
2522 (package
2523 (name "opendoas")
2524 (version "6.8.2")
2525 (source (origin
2526 (method git-fetch)
2527 (uri (git-reference
2528 (url "https://github.com/Duncaen/OpenDoas")
2529 (commit (string-append "v" version))))
2530 (file-name (git-file-name name version))
2531 (sha256
2532 (base32
2533 "1qrin7x9vcprk5pwjbr3w8z2qj8hk6xbvxicdhlk27xr6vcr1qzn"))))
2534 (build-system gnu-build-system)
2535 (arguments
2536 `(#:phases
2537 (modify-phases %standard-phases
2538 (add-before 'configure 'pre-configure
2539 (lambda* (#:key outputs #:allow-other-keys)
2540 (substitute* "GNUmakefile"
2541 (("^\tchown.*$") ""))
2542 ;; OpenDoas looks for binaries in safepath when a rule specifies a
2543 ;; relative command, such as “permit keepenv :wheel cmd guix”.
2544 (substitute* "doas.c"
2545 (("safepath =" match)
2546 (string-append match " \""
2547 "/run/privileged/bin:"
2548 "/run/current-system/profile/bin:"
2549 "/run/current-system/profile/sbin:"
2550 "\" ")))))
2551 (replace 'configure
2552 ;; The configure script doesn't accept most of the default flags.
2553 (lambda* (#:key configure-flags #:allow-other-keys)
2554 ;; The configure script can be told which compiler to use only
2555 ;; through environment variables.
2556 (setenv "CC" ,(cc-for-target))
2557 (apply invoke "./configure" configure-flags))))
2558 #:configure-flags
2559 (list (string-append "--prefix=" (assoc-ref %outputs "out"))
2560 "--with-timestamp")
2561 ;; Compiler choice is not carried over from the configure script.
2562 #:make-flags
2563 (list (string-append "CC=" ,(cc-for-target)))
2564 #:tests? #f)) ; no test suite
2565 (native-inputs
2566 (list bison))
2567 (inputs
2568 (list libxcrypt))
2569 (home-page "https://github.com/Duncaen/OpenDoas")
2570 (synopsis "Portable version of OpenBSD's doas command")
2571 (description "Doas is a minimal replacement for the venerable sudo. It was
2572initially written by Ted Unangst of the OpenBSD project to provide 95% of the
2573features of sudo with a fraction of the codebase.")
2574 (license (list license:bsd-3 ; libbsd/*
2575 license:isc)))) ; everything else
2576
2577(define-public wpa-supplicant-minimal
2578 (package
2579 (name "wpa-supplicant-minimal")
2580 (version "2.11")
2581 (source (origin
2582 (method url-fetch)
2583 (uri (string-append
2584 "https://w1.fi/releases/wpa_supplicant-"
2585 version ".tar.gz"))
2586 (sha256
2587 (base32
2588 "02pwqwdcirnyfmfzrc0xb66qs8gzrpb6905nzcv8w2p3fips0bli"))
2589 (modules '((guix build utils)))
2590 (snippet
2591 '(begin
2592 (substitute* "wpa_supplicant/defconfig"
2593 ;; Disable D-Bus to save ~14MiB on the closure size.
2594 (("^CONFIG_CTRL_IFACE_DBUS" line _)
2595 (string-append "#" line)))
2596 #t))))
2597 (build-system gnu-build-system)
2598 (arguments
2599 `(#:phases
2600 (modify-phases %standard-phases
2601 (replace 'configure
2602 (lambda _
2603 (chdir "wpa_supplicant")
2604 (copy-file "defconfig" ".config")
2605 (let ((port (open-file ".config" "al")))
2606 (display "
2607 CONFIG_DEBUG_SYSLOG=y
2608
2609 CONFIG_TLS=openssl
2610
2611 CONFIG_DRIVER_NL80211=y
2612 CFLAGS += $(shell pkg-config libnl-3.0 --cflags)
2613 CONFIG_LIBNL32=y
2614 CONFIG_READLINE=y\n" port)
2615 (close-port port))
2616 ;; Make sure we have a pkg-config when cross compiling
2617 (substitute* '(".config"
2618 "Android.mk"
2619 "Makefile"
2620 "dbus/Makefile")
2621 (("pkg-config")
2622 (or (which "pkg-config")
2623 (which (string-append ,(%current-target-system)
2624 "-pkg-config")))))
2625 #t))
2626 (add-after 'install 'install-documentation
2627 (lambda* (#:key outputs #:allow-other-keys)
2628 (let* ((out (assoc-ref outputs "out"))
2629 (doc (string-append out "/share/doc/wpa-supplicant"))
2630 (man (string-append out "/share/man"))
2631 (man5 (string-append man "/man5"))
2632 (man8 (string-append man "/man8")))
2633 (define (copy-man-page target)
2634 (lambda (file)
2635 (install-file file target)))
2636
2637 (mkdir-p man5) (mkdir man8)
2638 (for-each (copy-man-page man5)
2639 (find-files "doc/docbook" "\\.5"))
2640 (for-each (copy-man-page man8)
2641 (find-files "doc/docbook" "\\.8"))
2642
2643 ;; wpa_supplicant.conf(5) does not explain all configuration
2644 ;; options but refers to the example config file, so install it
2645 ;; along with READMEs.
2646 (for-each (lambda (file)
2647 (install-file file doc))
2648 '("README" "README-DPP" "README-HS20"
2649 "README-P2P" "README-WPS"
2650 "wpa_supplicant.conf"))
2651 #t))))
2652
2653 #:make-flags (list (string-append "CC=" ,(cc-for-target))
2654 (string-append "BINDIR=" (assoc-ref %outputs "out")
2655 "/sbin")
2656 (string-append "LIBDIR=" (assoc-ref %outputs "out")
2657 "/lib"))
2658 #:tests? #f))
2659 (inputs
2660 (list readline libnl openssl))
2661 (native-inputs
2662 (list pkg-config))
2663 (home-page "https://w1.fi/wpa_supplicant/")
2664 (synopsis "Connecting to WPA and WPA2-protected wireless networks")
2665 (description
2666 "wpa_supplicant is a WPA Supplicant with support for WPA and WPA2 (IEEE
2667802.11i / RSN). Supplicant is the IEEE 802.1X/WPA component that is used in
2668the client stations. It implements key negotiation with a WPA Authenticator
2669and it controls the roaming and IEEE 802.11 authentication/association of the
2670WLAN driver.
2671
2672This package provides the @code{wpa_supplicant} daemon and the @code{wpa_cli}
2673command.")
2674
2675 ;; In practice, this is linked against Readline, which makes it GPLv3+.
2676 (license license:bsd-3)
2677
2678 (properties `((cpe-name . "wpa_supplicant")))))
2679
2680(define-public wpa-supplicant
2681 (package (inherit wpa-supplicant-minimal)
2682 (name "wpa-supplicant")
2683 (inputs (modify-inputs inputs
2684 (prepend dbus)))
2685 (source (origin
2686 (inherit (package-source wpa-supplicant-minimal))
2687 (patches (search-patches
2688 "wpa-supplicant-dbus-group-policy.patch"))))
2689 (arguments
2690 (substitute-keyword-arguments arguments
2691 ((#:phases phases)
2692 `(modify-phases ,phases
2693 (add-after 'configure 'set-config-options
2694 (lambda _
2695 (let ((port (open-file ".config" "al")))
2696 ;; Enable Opportunistic Wireless Encryption (OWE) and D-Bus
2697 ;; support.
2698 (display "
2699 CONFIG_OWE=y
2700 CONFIG_CTRL_IFACE_DBUS_NEW=y
2701 CONFIG_CTRL_IFACE_DBUS_INTRO=y\n" port)
2702 (close-port port))))
2703 (add-after 'install-documentation 'install-dbus-conf
2704 (lambda* (#:key outputs #:allow-other-keys)
2705 (let* ((out (assoc-ref outputs "out"))
2706 (interfaces (string-append out "/etc/dbus-1/system.d"))
2707 (services (string-append out
2708 "/share/dbus-1/system-services")))
2709 (mkdir-p interfaces)
2710 (copy-file "dbus/dbus-wpa_supplicant.conf"
2711 (string-append interfaces "/wpa_supplicant.conf"))
2712 (mkdir-p services)
2713 (copy-file "dbus/fi.w1.wpa_supplicant1.service"
2714 (string-append services
2715 "/fi.w1.wpa_supplicant1.service")))
2716 #t))))))))
2717
2718(define-public wpa-supplicant-gui
2719 (package
2720 (inherit wpa-supplicant)
2721 (name "wpa-supplicant-gui")
2722 (inputs (modify-inputs inputs
2723 (prepend qtbase-5 qtsvg-5 qtwayland-5)))
2724 (native-inputs
2725 ;; For icons.
2726 (modify-inputs native-inputs
2727 (prepend imagemagick/stable
2728 inkscape/pinned)))
2729 (build-system qt-build-system)
2730 (arguments
2731 (list
2732 #:tests? #f ; no tests
2733 ;; Make sure the (rarely updated) package 'imagemagick/stable'
2734 ;; does not end up in the closure.
2735 #:disallowed-references (list (this-package-native-input "imagemagick"))
2736 #:modules '((guix build qt-build-system)
2737 ((guix build gnu-build-system) #:prefix gnu:)
2738 (guix build utils))
2739 #:phases
2740 #~(modify-phases %standard-phases
2741 (add-after 'unpack 'chdir
2742 (lambda _ (chdir "wpa_supplicant/wpa_gui-qt4")))
2743 (replace 'configure
2744 (lambda _ (invoke "qmake" "wpa_gui.pro")))
2745 (replace 'build (assoc-ref gnu:%standard-phases 'build))
2746 (add-after 'build 'build-icons
2747 (lambda _
2748 ;; Inkscape complains (but works) without a writable $HOME.
2749 (setenv "HOME" "/tmp")
2750 (invoke "make" "-C" "icons")))
2751 (replace 'install
2752 (lambda _
2753 (install-file "wpa_gui" (string-append #$output "/bin"))
2754 (install-file "wpa_gui.desktop"
2755 (string-append #$output
2756 "/share/applications"))
2757 (copy-recursively "icons/hicolor"
2758 (string-append #$output
2759 "/share/icons/hicolor")))))))
2760 (synopsis "Graphical user interface for WPA supplicant")))
2761
2762(define-public hostapd
2763 (package
2764 (name "hostapd")
2765 (version "2.10")
2766 (source (origin
2767 (method url-fetch)
2768 (uri (string-append "https://w1.fi/releases/hostapd-" version
2769 ".tar.gz"))
2770 (sha256
2771 (base32
2772 "0pcik0a6yin9nib02frjhaglmg44hwik086iwg1751b7kdwpqvi0"))))
2773 (build-system gnu-build-system)
2774 (arguments
2775 (list #:phases
2776 #~(modify-phases %standard-phases
2777 (replace 'configure
2778 (lambda _
2779 ;; This is mostly copied from 'wpa-supplicant' above.
2780 (chdir "hostapd")
2781 (copy-file "defconfig" ".config")
2782 (let ((port (open-file ".config" "al")))
2783 (display "CONFIG_LIBNL32=y
2784 CONFIG_IEEE80211R=y
2785 CONFIG_IEEE80211N=y
2786 CONFIG_IEEE80211AC=y
2787 CONFIG_FULL_DYNAMIC_VLAN=y
2788 CONFIG_ACS=y\n" port)
2789 (close-port port))))
2790 (add-after 'unpack 'patch-pkg-config
2791 (lambda _
2792 (substitute* "src/drivers/drivers.mak"
2793 (("pkg-config")
2794 #$(pkg-config-for-target)))))
2795 (add-after 'install 'install-man-pages
2796 (lambda* (#:key outputs #:allow-other-keys)
2797 (let* ((man (string-append #$output "/share/man"))
2798 (man1 (string-append man "/man1"))
2799 (man8 (string-append man "/man8")))
2800 (define (copy-man-page target)
2801 (lambda (file)
2802 (install-file file target)))
2803 (for-each (copy-man-page man1)
2804 (find-files "." "\\.1"))
2805 (for-each (copy-man-page man8)
2806 (find-files "." "\\.8"))))))
2807 #:make-flags
2808 #~(list (string-append "CC=" #$(cc-for-target))
2809 (string-append "BINDIR=" #$output "/sbin")
2810 (string-append "LIBDIR=" #$output "/lib"))
2811 #:tests? #f))
2812 (native-inputs (list pkg-config))
2813
2814 ;; There's an optional dependency on SQLite.
2815 (inputs (list openssl libnl))
2816 (home-page "https://w1.fi/hostapd/")
2817 (synopsis "Daemon for Wi-Fi access points and authentication servers")
2818 (description
2819 "hostapd is a user-space daemon for WiFi access points and authentication
2820servers. It implements IEEE 802.11 access point management, IEEE
2821802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS
2822authentication server.")
2823
2824 ;; Same license as wpa_supplicant.
2825 (license license:bsd-3)))
2826
2827(define-public dmidecode
2828 (package
2829 (name "dmidecode")
2830 (version "3.6")
2831 (source
2832 (origin
2833 (method url-fetch)
2834 (uri (string-append "mirror://savannah/dmidecode/dmidecode-"
2835 version ".tar.xz"))
2836 (sha256
2837 (base32 "1blbvmsxba71fmjxckh0cn7x68kim7qlx6ilv0df7brxxkrna374"))))
2838 (build-system gnu-build-system)
2839 (arguments
2840 (list #:tests? #f ; no 'check' target
2841 #:make-flags
2842 #~(list (string-append "CC=" #$(cc-for-target))
2843 (string-append "prefix=" #$output))
2844 #:phases
2845 #~(modify-phases %standard-phases
2846 (delete 'configure)))) ; no configure script
2847 (home-page "https://www.nongnu.org/dmidecode/")
2848 (synopsis "Read hardware information from the BIOS")
2849 (description
2850 "Dmidecode reports information about your system's hardware as described
2851in your system BIOS according to the SMBIOS/DMI standard. This typically
2852includes system manufacturer, model name, serial number, BIOS version, asset
2853tag as well as a lot of other details of varying level of interest and
2854reliability depending on the manufacturer. This will often include usage
2855status for the CPU sockets, expansion slots (e.g. AGP, PCI, ISA) and memory
2856module slots, and the list of I/O ports (e.g. serial, parallel, USB).")
2857 (license license:gpl2+)))
2858
2859(define-public acpica
2860 (package
2861 (name "acpica")
2862 (version "20250807")
2863 (source
2864 (origin
2865 (method git-fetch)
2866 (uri (git-reference
2867 (url "https://github.com/acpica/acpica")
2868 (commit version)))
2869 (file-name (git-file-name name version))
2870 (sha256
2871 (base32 "06jh7y9aimw132hgcivn144rp6br2r30jqizh7hrq3nl589f73ir"))))
2872 (build-system gnu-build-system)
2873 (native-inputs (list flex bison))
2874 (arguments
2875 (list
2876 #:make-flags
2877 #~(list (string-append "PREFIX=" #$output)
2878 (string-append "CC=" #$(cc-for-target))
2879 "HOST=_LINUX"
2880 "OPT_CFLAGS=-Wall -fno-strict-aliasing")
2881 #:tests? #f ;no test suite
2882 #:phases
2883 #~(modify-phases %standard-phases
2884 (delete 'configure)))) ;no configure script
2885 (home-page "https://acpica.org/")
2886 (synopsis "Tools for the development and debugging of ACPI tables")
2887 (description
2888 "The @acronym{ACPICA, ACPI Component Architecture} project provides an
2889OS-independent reference implementation of the @acronym{ACPI, Advanced
2890Configuration and Power Interface} specification. ACPICA code contains those
2891portions of ACPI meant to be directly integrated into the host OS as a
2892kernel-resident subsystem, and a small set of tools to assist in developing and
2893debugging ACPI tables.
2894
2895This package contains only the user-space tools needed for ACPI table
2896development, not the kernel implementation of ACPI.")
2897 (license license:gpl2))) ;dual GPLv2/ACPICA Licence
2898
2899(define-public s-tui
2900 (package
2901 (name "s-tui")
2902 (version "1.4.0")
2903 (source
2904 (origin
2905 (method git-fetch)
2906 (uri (git-reference
2907 (url "https://github.com/amanusk/s-tui")
2908 (commit (string-append "v" version))))
2909 (file-name (git-file-name name version))
2910 (sha256
2911 (base32 "1aj97xbdv01rsfjkn75g7y26knsyrw5nzr79x14vbixlnpgx6c1w"))))
2912 (build-system pyproject-build-system)
2913 (arguments
2914 (list
2915 #:phases #~(modify-phases %standard-phases
2916 (add-after 'unpack 'patch-/bin/sh
2917 (lambda _
2918 (substitute* (list "s_tui/sources/hook_script.py"
2919 "tests/test_hooks.py"
2920 "tests/test_helper_functions.py")
2921 (("/bin/sh") (which "sh"))))))))
2922 (native-inputs
2923 (list bash-minimal
2924 python-pytest
2925 python-pytest-mock
2926 python-setuptools))
2927 (inputs
2928 (list python-psutil
2929 python-urwid))
2930 (home-page "https://github.com/amanusk/s-tui")
2931 (synopsis "Interactive terminal stress test and monitoring tool")
2932 (description
2933 "The Stress Terminal UI displays graphs of the CPU frequency,
2934utilization, temperature and power.")
2935 (license license:gpl2+)))
2936
2937(define-public stress
2938 (package
2939 (name "stress")
2940 (version "1.0.7")
2941 (source (origin
2942 (method url-fetch)
2943 (uri (string-append "mirror://debian/pool/main/s/stress/stress_"
2944 version ".orig.tar.gz"))
2945 (sha256
2946 (base32
2947 "1cg0mklfrwfyzwqkzidd0151r8n2jgbiiqz1v0p3w4q62mkmdand"))
2948 (modules '((guix build utils)))
2949 (snippet
2950 #~(begin
2951 ;; The build fails with "implicit declaration of function
2952 ;; 'rpl_malloc'; did you mean 'realloc'?" when building
2953 ;; for RISCV64 target if "AC_FUNC_MALLOC" macro is present.
2954 ;; Remove it.
2955 (substitute* "configure.ac"
2956 (("AC_FUNC_MALLOC") ""))))))
2957 (build-system gnu-build-system)
2958 (native-inputs
2959 (list autoconf automake))
2960 (home-page "https://packages.debian.org/sid/stress")
2961 (synopsis "Impose load on and stress test a computer system")
2962 (description
2963 "Stress is a tool that imposes a configurable amount of CPU, memory, I/O,
2964or disk stress on a POSIX-compliant operating system and reports any errors it
2965detects.
2966
2967Stress is not a benchmark. It is a tool used by system administrators to
2968evaluate how well their systems will scale, by kernel programmers to evaluate
2969perceived performance characteristics, and by systems programmers to expose
2970the classes of bugs which only or more frequently manifest themselves when the
2971system is under heavy load.")
2972 (license license:gpl2+)))
2973
2974(define-public stress-ng
2975 (package
2976 (name "stress-ng")
2977 (version "0.22.00")
2978 (source
2979 (origin
2980 (method git-fetch)
2981 (uri (git-reference
2982 (url "https://github.com/ColinIanKing/stress-ng")
2983 (commit (string-append "V" version))))
2984 (file-name (git-file-name name version))
2985 (sha256
2986 (base32 "1nqypaf9jngnpxfdwn3j255axb6r9n1gprc1lslvv6p99s8kyhh3"))))
2987 (build-system gnu-build-system)
2988 (arguments
2989 ;; XXX The test suite seems to cause instability on the VisionFive 2
2990 ;; build machines, maybe it's stressing them as intended but this is
2991 ;; unhelpful.
2992 (list #:tests? (and (not (%current-target-system))
2993 (not (target-riscv64?)))
2994 #:make-flags
2995 #~(list (string-append "CC=" #$(cc-for-target))
2996 (string-append "BINDIR=" #$output "/bin")
2997 ;; XXX Really: MAN1DIR, or man pages won't be found.
2998 (string-append "MANDIR=" #$output "/share/man/man1")
2999 (string-append "JOBDIR=" #$output
3000 "/share/stress-ng/example-jobs")
3001 (string-append "BASHDIR=" #$output
3002 "/share/bash-completion/completions"))
3003 ;; There is also a fast-test-all that very briefly runs every single
3004 ;; stressor, but its utility is questionable compared to its cost.
3005 ;; See this package's git history for details & which tests to skip.
3006 #:test-target "lite-test"
3007 #:phases
3008 #~(modify-phases %standard-phases
3009 (delete 'configure)))) ;no configure script
3010 (inputs
3011 (list keyutils
3012 kmod
3013 libaio
3014 libbsd
3015 libcap
3016 libgcrypt
3017 zlib))
3018 (home-page "https://github.com/ColinIanKing/stress-ng")
3019 (synopsis "Load and stress-test a computer system in various ways")
3020 (description
3021 "stress-ng stress-tests a computer system by exercising both physical
3022subsystems as operating system kernel interfaces. It can stress the CPU, cache,
3023disk, memory, socket and pipe I/O, scheduling, and much more, in various
3024selectable ways. This can trip hardware issues such as thermal overruns as well
3025as operating system bugs that occur only when a system is being thrashed hard.
3026
3027You can also measure test throughput rates, which can be useful to observe
3028performance changes across different operating system releases or types of
3029hardware. However, stress-ng is not a benchmark. Use it with caution: some of
3030the tests can make poorly designed hardware run dangerously hot or make the
3031whole system lock up.
3032
3033Compared to its inspiration, @command{stress}, @command{stress-ng} offers many
3034additional options such as the number of bogo operations to run, execution
3035metrics, verification of memory and computational operations, and considerably
3036more stress mechanisms.")
3037 (license license:gpl2+)))
3038
3039(define-public tree
3040 (package
3041 (name "tree")
3042 (version "2.3.2")
3043 (source (origin
3044 (method url-fetch)
3045 (uri (string-append "https://oldmanprogrammer.net/tar/tree/"
3046 "tree-" version ".tgz"))
3047 (sha256
3048 (base32 "088f60s44x0dp5l4ipc1i5453hp0v044s3kha0r4vyzcrgb1v53b"))))
3049 (build-system gnu-build-system)
3050 (arguments
3051 (list
3052 #:phases
3053 #~(modify-phases %standard-phases
3054 (delete 'configure)) ; No configure script.
3055 #:tests? #f ; No check target.
3056 #:make-flags
3057 #~(list (string-append "PREFIX=" #$output)
3058 (string-append "CC=" #$(cc-for-target)))))
3059 (synopsis "Recursively list the contents of a directory")
3060 (description
3061 "Tree is a recursive directory listing command that produces a depth
3062indented listing of files, which is colorized ala dircolors if the LS_COLORS
3063environment variable is set and output is to tty.")
3064 (home-page "https://oldmanprogrammer.net/source.php?dir=projects/tree")
3065 (license license:gpl2+)))
3066
3067(define-public lr
3068 (package
3069 (name "lr")
3070 (version "2.0.1")
3071 (source
3072 (origin
3073 (method git-fetch)
3074 (uri (git-reference
3075 (url "https://git.vuxu.org/lr/")
3076 (commit (string-append "v" version))))
3077 (file-name (git-file-name name version))
3078 (sha256
3079 (base32 "0mqhcgi4v3zzic0ikf7ja4km1mik29gdp15q8qwjw5bmh22d74ff"))))
3080 (build-system gnu-build-system)
3081 (arguments
3082 (list #:tests? #f ; There are no tests.
3083 #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
3084 (string-append "PREFIX=" #$output))
3085 #:phases #~(modify-phases %standard-phases
3086 (delete 'configure))))
3087 (synopsis "Tool to generate customized file listings")
3088 (description
3089 "lr is a tool for generating file listings, which includes the best
3090features of ls(1), find(1), stat(1) and du(1).")
3091 (home-page "https://git.vuxu.org/lr/about")
3092 (license license:expat)))
3093
3094(define-public direvent
3095 (package
3096 (name "direvent")
3097 (version "5.5")
3098 (source (origin
3099 (method url-fetch)
3100 (uri (string-append "mirror://gnu/direvent/direvent-"
3101 version ".tar.gz"))
3102 (sha256
3103 (base32
3104 "1dywdzwzjn1g7cpm2f1mz0iasdhjn0ddhcagkcz6gxz6nfsc05hf"))))
3105 (build-system gnu-build-system)
3106 (arguments
3107 (list #:phases
3108 #~(modify-phases %standard-phases
3109 (add-before 'build 'substitute-file-names
3110 (lambda _
3111 ;; Use the right shell when executing the watcher and
3112 ;; user-provided shell commands.
3113 (let ((bash #$(this-package-input "bash-minimal")))
3114 (substitute* '("src/direvent.c" "src/progman.c")
3115 (("\"/bin/sh\"")
3116 (string-append "\"" bash "/bin/sh\""))))
3117
3118 ;; Adjust the test suite similarly.
3119 (substitute* "tests/testsuite"
3120 (("(SHELL=|#![[:space:]]*)/bin/sh" _ prefix)
3121 (string-append prefix (which "sh")))
3122 (("/bin/kill")
3123 (which "kill"))))))))
3124 (inputs (list bash-minimal))
3125 (home-page "https://www.gnu.org.ua/software/direvent/")
3126 (synopsis "Daemon to monitor directories for events such as file removal")
3127 (description
3128 "A daemon that monitors directories for events, such as creating,
3129deleting or modifying files. It can monitor different sets of directories for
3130different events. When an event is detected, direvent calls a specified
3131external program with information about the event, such as the location
3132within the file system where it occurred. Thus, \"direvent\" provides an
3133easy way to react immediately if given files undergo changes, for example, to
3134track changes in important system configuration files.")
3135 (license license:gpl3+)))
3136
3137(define-public libcap-ng
3138 (package
3139 (name "libcap-ng")
3140 (version "0.9.6")
3141 (source (origin
3142 (method git-fetch)
3143 (uri (git-reference
3144 (url "https://github.com/stevegrubb/libcap-ng")
3145 (commit (string-append "v" version))))
3146 (file-name (git-file-name name version))
3147 (sha256
3148 (base32
3149 "1xlsq97k8l3mcq7zpx9cz6cqmnv31000klvngjcfzqrla5rbfszv"))))
3150 (build-system gnu-build-system)
3151 (arguments
3152 (list
3153 #:configure-flags
3154 #~(list "--disable-static"
3155 "--without-python")))
3156 (inputs
3157 (list libbpf))
3158 (native-inputs
3159 (list autoconf automake libtool pkg-config))
3160 (home-page "https://people.redhat.com/sgrubb/libcap-ng/")
3161 (synopsis "Library for more easily working with POSIX capabilities")
3162 (description
3163 "The libcap-ng library is intended to make programming with POSIX
3164capabilities easier than the traditional libcap library. It includes
3165utilities that can analyse all currently running applications and print out
3166any capabilities and whether or not it has an open ended bounding set. The
3167included utilities are designed to let admins and developers spot apps from
3168various ways that may be running with too much privilege.")
3169 ;; The library is lgpl2.1+, but also ships some utils which are gpl2+.
3170 (license (list license:lgpl2.1+ license:gpl2+))))
3171
3172(define-public smartmontools
3173 (package
3174 (name "smartmontools")
3175 (version "7.5")
3176 (source
3177 (origin
3178 (method git-fetch)
3179 (uri (git-reference
3180 (url "https://github.com/smartmontools/smartmontools")
3181 (commit (string-append "RELEASE_"
3182 (string-replace-substring version "." "_")))))
3183 (file-name (git-file-name name version))
3184 (sha256
3185 (base32 "00c58xcqv73lzxf0baly2q0sqkyd2vncv93iabjj7jkvbzf7nqpz"))))
3186 (build-system gnu-build-system)
3187 (arguments
3188 (list
3189 #:make-flags
3190 #~(list "BUILD_INFO=\"(Guix)\"")
3191 #:phases
3192 #~(modify-phases %standard-phases
3193 (add-after 'unpack 'chdir
3194 (lambda _
3195 (chdir "smartmontools"))))
3196 #:configure-flags
3197 #~(list (format #f "--with-scriptpath=~{~a:~}$PATH"
3198 (map (lambda (pkg)
3199 (in-vicinity pkg "bin"))
3200 '#$(list (this-package-input "coreutils-minimal")
3201 (this-package-input "sed")))))))
3202 (inputs (list automake autoconf coreutils-minimal libcap-ng sed))
3203 (home-page "https://www.smartmontools.org/")
3204 (synopsis "S.M.A.R.T. harddisk control and monitoring tools")
3205 (description
3206 "The smartmontools package contains utility programs to control and
3207monitor storage systems using the Self-Monitoring, Analysis and Reporting
3208Technology System (@dfn{S.M.A.R.T.}) built into most modern ATA and SCSI hard
3209disks. In many cases, these utilities will provide advanced warning of disk
3210degradation and failure.")
3211 (license license:gpl2+)))
3212
3213(define-public fdupes
3214 (package
3215 (name "fdupes")
3216 (version "2.4.0")
3217 (source
3218 (origin
3219 (method url-fetch)
3220 (uri (string-append "https://github.com/adrianlopezroche/fdupes/"
3221 "releases/download/v" version "/"
3222 "fdupes-" version ".tar.gz"))
3223 (sha256
3224 (base32 "0dhpgcylf99cnxz8h4i4dhv2i3124cs0n8lssbhwn783knijfysj"))))
3225 (build-system gnu-build-system)
3226 (inputs
3227 (list ncurses pcre2 sqlite))
3228 (home-page "https://github.com/adrianlopezroche/fdupes")
3229 (synopsis "Identify duplicate files")
3230 (description
3231 "fdupes is a program for identifying duplicate files residing within
3232specified directories.")
3233 (license license:expat)))
3234
3235(define-public ansible-core
3236 (package
3237 (name "ansible-core")
3238 (version "2.21.2")
3239 (source
3240 (origin
3241 (method url-fetch)
3242 (uri (pypi-uri "ansible_core" version))
3243 (sha256
3244 (base32 "0w6wv6k39d5xn60l5m4cbzwwgpsyz8mg2ab0y5dgn6ys5rk9w4y6"))))
3245 (build-system pyproject-build-system)
3246 (arguments
3247 (list
3248 #:test-flags
3249 #~(list "units"
3250 "--exclude" "test/units/cli/test_adhoc.py"
3251 "--exclude" "test/units/galaxy/test_collection_install.py"
3252 "--num-workers" (number->string (parallel-job-count)))
3253 #:phases
3254 #~(modify-phases %standard-phases
3255 (add-before 'build 'set-HOME
3256 (lambda _
3257 ;; Otherwise Ansible fails to create its config directory.
3258 (setenv "HOME" "/tmp")))
3259 (add-after 'unpack 'patch-paths
3260 (lambda* (#:key inputs #:allow-other-keys)
3261 (substitute* "lib/ansible/_internal/_encryption/_crypt.py"
3262 (("lib_so = ctypes\\.util\\.find_library\\(lib_config\\.name\\)")
3263 (string-append "lib_so = '"
3264 (search-input-file inputs "/lib/libcrypt.so.1")
3265 "'")))
3266 (substitute* "lib/ansible/module_utils/compat/selinux.py"
3267 (("libselinux.so.1")
3268 (search-input-file inputs "/lib/libselinux.so.1")))
3269 (substitute* "test/lib/ansible_test/_internal/ansible_util.py"
3270 (("PYTHONPATH=get_ansible_python_path\\(args\\)" all)
3271 (string-append all "+ ':' + os.environ['GUIX_PYTHONPATH']")))
3272 (substitute* "test/lib/ansible_test/_internal/commands/units/__init__.py"
3273 (("PYTHONPATH=get_units_ansible_python_path\\(args, test_context)" all)
3274 (string-append all "+ ':' + os.environ['GUIX_PYTHONPATH']")))
3275 (substitute* "test/units/modules/test_async_wrapper.py"
3276 (("/usr/bin/python")
3277 (search-input-file inputs "/bin/python3")))))
3278 (replace 'check
3279 (lambda* (#:key tests? test-flags #:allow-other-keys)
3280 (when tests?
3281 (setenv "PYTHONPATH"
3282 (string-append "lib:test/lib:"
3283 (getenv "GUIX_PYTHONPATH")))
3284 ;; The test suite needs to be run with 'ansible-test', which
3285 ;; does some extra environment setup. Taken from
3286 ;; https://raw.githubusercontent.com/ansible/ansible/\
3287 ;; devel/test/utils/shippable/shippable.sh.
3288 (apply invoke "python"
3289 (string-append "test/lib/ansible_test/_util/"
3290 "target/cli/ansible_test_cli_stub.py")
3291 test-flags)))))))
3292 (native-inputs
3293 (list openssh
3294 openssl
3295 python-mock
3296 python-pycryptodome
3297 python-pytest
3298 python-pytest-mock
3299 python-pytest-xdist
3300 python-pytz
3301 python-setuptools
3302 util-linux))
3303 (inputs ;optional dependencies captured in wrap scripts
3304 (list libselinux
3305 libxcrypt
3306 sshpass))
3307 (propagated-inputs ;core dependencies listed in egg-info/requires.txt
3308 (list python-cryptography
3309 python-jinja2
3310 python-packaging ;for version number parsing
3311 python-paramiko
3312 python-passlib
3313 python-pexpect
3314 python-pyyaml
3315 python-resolvelib))
3316 (home-page "https://www.ansible.com/")
3317 (synopsis "Radically simple IT automation")
3318 (description "Ansible aims to be a radically simple IT automation system.
3319It handles configuration management, application deployment, cloud
3320provisioning, ad-hoc task execution, network automation, and multi-node
3321orchestration. Ansible facilitates complex changes like zero-downtime rolling
3322updates with load balancers. This package is the core of Ansible, which
3323provides the following commands:
3324@itemize
3325@item ansible
3326@item ansible-config
3327@item ansible-connection
3328@item ansible-console
3329@item ansible-doc
3330@item ansible-galaxy
3331@item ansible-inventory
3332@item ansible-playbook
3333@item ansible-pull
3334@item ansible-test
3335@item ansible-vault
3336@end itemize")
3337 (license license:gpl3+)))
3338
3339(define-public ansible
3340 (package
3341 (name "ansible")
3342 (version "14.2.0")
3343 (source
3344 (origin
3345 (method url-fetch)
3346 (uri (pypi-uri "ansible" version))
3347 (sha256
3348 (base32 "098hji4slkli5hj015p7xwbbxycrmlxvc317fl0npli7j0wii3qw"))))
3349 (build-system pyproject-build-system)
3350 (arguments
3351 (list
3352 ;; XXX: All tests errored with:
3353 ;; from ...common.utils import (
3354 ;; E ImportError: attempted relative import with no known parent package
3355 ;;
3356 ;; tests: 17 skipped, 1 warning, 1132 errors
3357 #:tests? #f))
3358 (native-inputs
3359 (list python-setuptools))
3360 (propagated-inputs (list ansible-core))
3361 ;; The Ansible collections are found by ansible-core via the Python search
3362 ;; path; the following search path ensures that they are found even when
3363 ;; Python is not present in the profile.
3364 (native-search-paths
3365 ;; XXX: Attempting to use (package-native-search-paths python)
3366 ;; here would cause an error about python being an unbound
3367 ;; variable in the tests/import/cpan.scm test.
3368 (list (search-path-specification
3369 (variable "GUIX_PYTHONPATH")
3370 (files (list "lib/python3.12/site-packages")))))
3371 (home-page "https://www.ansible.com/")
3372 (synopsis "Radically simple IT automation")
3373 (description "Ansible aims to be a radically simple IT automation system.
3374It handles configuration management, application deployment, cloud
3375provisioning, ad-hoc task execution, network automation, and multi-node
3376orchestration. Ansible facilitates complex changes like zero-downtime rolling
3377updates with load balancers. This package provides a curated set of
3378community-maintained Ansible collections, which contain playbooks, roles,
3379modules and plugins that extend Ansible.")
3380 (license license:gpl3+)))
3381
3382(define-public debops
3383 (package
3384 (name "debops")
3385 (version "3.3.0")
3386 (source
3387 (origin
3388 (method git-fetch)
3389 (uri (git-reference
3390 (url "https://github.com/debops/debops")
3391 (commit (string-append "v" version))))
3392 (file-name (git-file-name name version))
3393 (sha256
3394 (base32 "0z6wck5kax5h2bjv1vw8pbd7fdcdhx87bj9fakh3h0rar9d2qksj"))
3395 (patches
3396 (search-patches "debops-setup-py-avoid-git.patch"))))
3397 (build-system pyproject-build-system)
3398 (native-inputs (list python-setuptools))
3399 (inputs
3400 (list ansible
3401 bash-minimal
3402 fuse
3403 util-linux ;; for umount
3404 findutils
3405 git
3406 git-crypt
3407 gnupg
3408 which))
3409 (propagated-inputs
3410 (list python-distro
3411 python-dotenv
3412 python-future
3413 python-gitpython
3414 python-jinja2
3415 python-pyxdg
3416 python-pyyaml
3417 python-toml))
3418 (arguments
3419 (list
3420 #:tests? #f ;no tests
3421 #:modules '((guix build pyproject-build-system)
3422 (guix build utils)
3423 (srfi srfi-26))
3424 #:phases #~(modify-phases %standard-phases
3425 (add-after 'sanity-check 'wrap-script
3426 (lambda* (#:key inputs #:allow-other-keys)
3427 (wrap-program (string-append #$output "/bin/debops")
3428 `("PATH" ":" prefix
3429 ,(map dirname
3430 (map (cut search-input-file inputs <>)
3431 (list ;; "bin/ansible" ;see above
3432 "bin/gpg"
3433 "bin/git"
3434 "bin/git-crypt"
3435 "bin/umount"))))))))))
3436 (home-page "https://www.debops.org/")
3437 (synopsis "Collection of general-purpose Ansible roles")
3438 (description "The Ansible roles provided by that can be used to manage
3439Debian or Ubuntu hosts. In addition, a default set of Ansible playbooks can
3440be used to apply the provided roles in a controlled way, using Ansible
3441inventory groups.
3442
3443The roles are written with a high customization in mind, which can be done
3444using Ansible inventory. This way the role and playbook code can be shared
3445between multiple environments, with different configuration in to each one.
3446
3447Services can be managed on a single host, or spread between multiple hosts.
3448DebOps provides support for different SQL and NoSQL databases, web servers,
3449programming languages and specialized applications useful in a data center
3450environment or in a cluster. The project can also be used to deploy
3451virtualization environments using KVM/libvirt, Docker or LXC technologies to
3452manage virtual machines and/or containers.")
3453 (license license:gpl3+)))
3454
3455(define-public cpulimit
3456 (package
3457 (name "cpulimit")
3458 (version "0.2")
3459 (source
3460 (origin
3461 (method git-fetch)
3462 (uri (git-reference
3463 (url "https://github.com/opsengine/cpulimit")
3464 (commit (string-append "v" version))))
3465 (file-name (git-file-name name version))
3466 (sha256
3467 (base32 "1dz045yhcsw1rdamzpz4bk8mw888in7fyqk1q1b3m1yk4pd1ahkh"))
3468 (patches (search-patches "cpulimit-with-glib-2.32.patch"))))
3469 (build-system gnu-build-system)
3470 (arguments
3471 `(#:phases (modify-phases %standard-phases
3472 (delete 'configure)
3473 (replace 'build
3474 (lambda* (#:key make-flags #:allow-other-keys)
3475 (apply invoke "make" "-Csrc" make-flags)))
3476 (replace 'check
3477 (lambda* (#:key tests? make-flags #:allow-other-keys)
3478 (when tests?
3479 (apply invoke "make" "-Ctests" make-flags))
3480 #t))
3481 (replace 'install
3482 (lambda* (#:key outputs #:allow-other-keys)
3483 (let* ((out (assoc-ref outputs "out"))
3484 (bin (string-append out "/bin")))
3485 (install-file "src/cpulimit" bin))
3486 #t)))
3487 #:make-flags (list (string-append "CC=" ,(cc-for-target)))))
3488 (home-page "https://github.com/opsengine/cpulimit")
3489 (synopsis "Limit CPU usage")
3490 (description
3491 "Cpulimit limits the CPU usage of a process. It does not change the nice
3492value or other scheduling priority settings, but the real CPU usage, and is
3493able to adapt itself dynamically to the overall system load. Children
3494processes and threads of the specified process may optionally share the same
3495limits.")
3496 (license license:gpl2+)))
3497
3498(define-public corectrl
3499 (package
3500 (name "corectrl")
3501 (version "1.5.1")
3502 (source
3503 (origin
3504 (method git-fetch)
3505 (uri (git-reference
3506 (url "https://gitlab.com/corectrl/corectrl")
3507 (commit (string-append "v" version))))
3508 (file-name (git-file-name name version))
3509 (sha256
3510 (base32 "0y2qjp73kl7m6sx99kc0myfvvlf0rjx2yb3hff7jr6l87ayan09p"))
3511 (patches (search-patches "corectrl-locate-polkit-with-pkg-config.patch"))))
3512 (build-system qt-build-system)
3513 (arguments
3514 (list
3515 #:configure-flags #~(list "-DINSTALL_DBUS_FILES_IN_PREFIX=true"
3516 (string-append "-DPOLKIT_POLICY_INSTALL_DIR="
3517 #$output
3518 "/share/polkit-1/actions")
3519 (string-append "-DWITH_PCI_IDS_PATH="
3520 #$(this-package-input "hwdata")
3521 "/share/hwdata/pci.ids"))
3522 #:phases
3523 #~(modify-phases %standard-phases
3524 (add-after 'unpack 'embed-absolute-references
3525 (lambda* (#:key inputs #:allow-other-keys)
3526 (substitute* "src/core/info/common/cpuinfolscpu.cpp"
3527 (("\"lscpu\"")
3528 (string-append
3529 "\"" (search-input-file inputs "bin/lscpu") "\"")))
3530 (substitute* "src/core/info/common/gpuinfovulkan.cpp"
3531 (("\"vulkaninfo\"")
3532 (string-append
3533 "\"" (search-input-file inputs "bin/vulkaninfo") "\"")))
3534 (substitute* (list "src/core/info/common/swinfomesa.cpp"
3535 "src/core/info/common/gpuinfoopengl.cpp")
3536 (("\"glxinfo\"")
3537 (string-append
3538 "\"" (search-input-file inputs "bin/glxinfo") "\""))))))))
3539 (native-inputs (list catch2
3540 pkg-config
3541 qttools))
3542 (inputs (list dbus
3543 botan
3544 hwdata
3545 mesa-utils
3546 polkit
3547 procps
3548 pugixml
3549 qt5compat
3550 qtbase
3551 qtcharts
3552 qtdeclarative
3553 qtquickcontrols2-5
3554 qtsvg
3555 qtwayland
3556 quazip
3557 spdlog
3558 trompeloeil
3559 units
3560 util-linux
3561 vulkan-tools
3562 zlib))
3563 (home-page "https://gitlab.com/corectrl/corectrl")
3564 (synopsis "Profile based system control utility")
3565 (description
3566 "CoreCtrl allows you to control with ease your computer hardware using
3567application profiles.")
3568 (license (list license:gpl3))))
3569
3570(define-public autojump
3571 (package
3572 (name "autojump")
3573 (version "22.5.3")
3574 (source
3575 (origin
3576 (method git-fetch)
3577 (uri (git-reference
3578 (url "https://github.com/wting/autojump")
3579 (commit (string-append "release-v" version))))
3580 (file-name (git-file-name name version))
3581 (sha256
3582 (base32 "1rgpsh70manr2dydna9da4x7p8ahii7dgdgwir5fka340n1wrcws"))))
3583 (build-system gnu-build-system)
3584 (native-inputs ; for tests
3585 (list python-mock python-pytest))
3586 (inputs
3587 `(("python" ,python-wrapper)))
3588 (arguments
3589 `(#:phases
3590 (modify-phases %standard-phases
3591 (add-after 'unpack 'make-git-checkout-writable
3592 ;; ‘install.py’ modifies files before installing them.
3593 (lambda _
3594 (for-each make-file-writable (find-files "."))
3595 #t))
3596 (delete 'configure)
3597 (delete 'build)
3598 (replace 'check
3599 (lambda _
3600 (invoke "python" "tests/unit/autojump_utils_test.py")))
3601 (replace 'install
3602 (lambda* (#:key outputs #:allow-other-keys)
3603 (setenv "SHELL" (which "bash"))
3604 (invoke "python" "install.py"
3605 (string-append "--destdir="
3606 (assoc-ref outputs "out"))))))))
3607 (home-page "https://github.com/wting/autojump")
3608 (synopsis "Shell extension for file system navigation")
3609 (description
3610 "Autojump provides a faster way to navigate your file system, with a \"cd
3611command that learns\". It works by maintaining a database of the directories
3612you use the most from the command line and allows you to \"jump\" to
3613frequently used directories by typing only a small pattern.")
3614 (license license:gpl3+)))
3615
3616(define-public fasd
3617 (package
3618 (name "fasd")
3619 (version "1.0.2")
3620 (source (origin
3621 (method git-fetch)
3622 (uri (git-reference
3623 (url "https://github.com/whjvenyl/fasd")
3624 (commit version)))
3625 (file-name (git-file-name name version))
3626 (sha256
3627 (base32
3628 "0q72a54dcahc9pan5qkmnsvpqiqgjjxwdxzzm8pxzylpr329jjyh"))))
3629 (build-system gnu-build-system)
3630 (arguments
3631 `(#:phases (modify-phases %standard-phases
3632 (delete 'configure)) ;no configuration
3633 #:tests? #f ;no tests
3634 #:make-flags (list (string-append "PREFIX=" %output))))
3635 (home-page "https://github.com/whjvenyl/fasd")
3636 (synopsis "Quick access to files and directories for shells")
3637 (description
3638 "Fasd (pronounced similar to \"fast\") is a command-line productivity booster.
3639Fasd offers quick access to files and directories for POSIX shells. It is inspired
3640by tools like @code{autojump}, @code{z}, and @code{v}. Fasd keeps track of files and
3641directories you have accessed so that you can quickly reference them in the command
3642line.")
3643 (license license:expat)))
3644
3645(define-public iftop
3646 (package
3647 (name "iftop")
3648 (version "1.0pre4")
3649 (source (origin
3650 (method url-fetch)
3651 (uri (string-append "http://www.ex-parrot.com/~pdw/iftop/download"
3652 "/iftop-" version ".tar.gz"))
3653 (sha256
3654 (base32
3655 "15sgkdyijb7vbxpxjavh5qm5nvyii3fqcg9mzvw7fx8s6zmfwczp"))))
3656 (build-system gnu-build-system)
3657 (inputs
3658 (list libpcap ncurses))
3659 (arguments
3660 ;; Fix build failure with GCC 10
3661 '(#:configure-flags '("CFLAGS=-O2 -g -fcommon")))
3662 (synopsis "Monitor network usage")
3663 (description "Iftop does for network usage what @command{top} does
3664for CPU usage. It listens to network traffic on a named interface and
3665displays a table of current bandwidth usage by pairs of hosts.")
3666 (home-page "http://www.ex-parrot.com/~pdw/iftop/")
3667 (license license:gpl2+)))
3668
3669(define-public nettop
3670 (let ((revision "0")
3671 (commit "689d6557196e9fcc92cffba82e00fac0386419e5"))
3672 (package
3673 (name "nettop")
3674 (version (git-version "0.5" revision commit))
3675 (source
3676 (origin
3677 (method git-fetch)
3678 (uri (git-reference
3679 (url "https://github.com/Emanem/nettop")
3680 (commit commit)))
3681 (file-name (git-file-name name version))
3682 (sha256
3683 (base32 "0f6qkj4p4c0gap16ncnhkm802vi6dr7z9rjfz7gzvzhm7jg08aj8"))
3684 (modules '((guix build utils)))
3685 (snippet
3686 #~(begin
3687 (substitute* "Makefile"
3688 (("-lcurses" _) "-lncurses"))))))
3689 (build-system gnu-build-system)
3690 (arguments
3691 (list
3692 #:tests? #f ; no make check
3693 #:make-flags #~(list "release")
3694 #:phases
3695 #~(modify-phases %standard-phases
3696 (delete 'configure) ; no configure script
3697 (replace 'install ; no install target
3698 (lambda _
3699 (let ((out (string-append #$output "/bin")))
3700 (install-file "nettop" out)))))))
3701 (inputs (list libpcap ncurses))
3702 (synopsis "Monitor network usage by process and host")
3703 (description "nettop is a traffic visualizer for the terminal that
3704summarizes network bandwidth by process and remote host.")
3705 (home-page "https://github.com/Emanem/nettop")
3706 (license license:gpl3+))))
3707
3708(define-public munge
3709 (package
3710 (name "munge")
3711 (version "0.5.18")
3712 (source (origin
3713 (method git-fetch)
3714 (uri (git-reference
3715 (url "https://github.com/dun/munge")
3716 (commit (string-append "munge-" version))))
3717 (file-name (git-file-name name version))
3718 (sha256
3719 (base32
3720 "1b7gm680dlvmgvj9vxy7n0cqmnv1rl9n4563vasxdxx54f78j30s"))
3721 (modules '((guix build utils)))
3722 (snippet
3723 ;; Don't insist on write access to /var.
3724 #~(substitute* "src/etc/Makefile.am"
3725 (("\\$\\(MKDIR_P\\) .*(local|run)statedir.*" all)
3726 (string-append ": " all))))))
3727 (inputs
3728 (list openssl libgcrypt))
3729 (native-inputs
3730 (list autoconf
3731 automake
3732 libtool
3733 procps)) ;for tests
3734 (build-system gnu-build-system)
3735 (arguments
3736 (list #:configure-flags
3737 #~(list "--localstatedir=/var"
3738 "--disable-static"
3739 #$@(if (%current-target-system)
3740 ;; Assume yes on pipes when cross compiling.
3741 `("ac_cv_file__dev_spx=yes"
3742 "x_ac_cv_check_fifo_recvfd=yes")
3743 '())
3744
3745 ;; The '.pc' file is not installed when omitting this flag.
3746 (string-append "--with-pkgconfigdir="
3747 #$output "/lib/pkgconfig"))
3748 #:phases
3749 #~(modify-phases %standard-phases
3750 (add-before 'bootstrap 'pre-bootstrap
3751 (lambda _
3752 (for-each patch-shebang (find-files "build-aux"))))
3753 (add-after 'unpack 'skip-failing-tests
3754 (lambda _
3755 ;; Pass '--force' to 'munged'; without it, it fails with "Socket
3756 ;; is inaccessible" due to the build directory not being
3757 ;; world-readable.
3758 (substitute* "tests/sharness.d/03-munged.sh"
3759 (("--group-update-time=-1" all)
3760 (string-append all " --force")))
3761
3762 ;; The tests below invoke 'sudo' or have special expectations
3763 ;; about network interfaces.
3764 (for-each (lambda (test)
3765 (substitute* "tests/Makefile.am"
3766 (((string-append test "\\.t "))
3767 "")))
3768 (list "0100-munged-lock"
3769 "0101-munged-security-socket"
3770 "0102-munged-security-keyfile"
3771 "0103-munged-security-logfile"
3772 "0110-munged-origin-addr")))))))
3773 (home-page "https://dun.github.io/munge/")
3774 (synopsis "Cluster computing authentication service")
3775 (description
3776 "Munge is an authentication service for creating and validating
3777credentials. It allows a process to authenticate the UID and GID of another
3778local or remote process within a group of hosts having common users and
3779groups. These hosts form a security realm that is defined by a shared
3780cryptographic key. Clients within this security realm can create and validate
3781credentials without the use of root privileges, reserved ports, or
3782platform-specific methods.")
3783 (license license:gpl3+)))
3784
3785(define-public audit
3786 (package
3787 (name "audit")
3788 (home-page "https://people.redhat.com/sgrubb/audit/")
3789 (version "3.0.9")
3790 (source (origin
3791 (method url-fetch)
3792 (uri (string-append home-page "audit-" version ".tar.gz"))
3793 (sha256
3794 (base32
3795 "0y5w8pl91xapi49ih1pw7h48lac201cj7fm89hkklmzi9m2715gx"))))
3796 (build-system gnu-build-system)
3797 (arguments
3798 (list #:configure-flags
3799 #~(list #$@(cond ((target-aarch64?)
3800 '("--with-aarch64"))
3801 ((target-arm32?)
3802 '("--with-arm"))
3803 (else
3804 '()))
3805 "--with-python=no"
3806 "--disable-static")))
3807 (inputs
3808 (list openldap gnutls cyrus-sasl))
3809 (synopsis "User-space component to the Linux auditing system")
3810 (description
3811 "This is the user-space component to the Linux auditing system, which
3812allows logging of system calls made by user-land processes. @command{auditd} is
3813responsible for writing audit records to the disk. Viewing the logs is done
3814with the @code{ausearch} or @code{aureport} utilities. Configuring the audit
3815rules is done with the @code{auditctl} utility.")
3816 (license license:gpl2+)))
3817
3818(define-public nmap
3819 (package
3820 (name "nmap")
3821 (version "7.991")
3822 (source (origin
3823 (method url-fetch)
3824 (uri (string-append "https://nmap.org/dist/nmap-" version
3825 ".tar.bz2"))
3826 (sha256
3827 (base32
3828 "1gi9d52jf87i3idizfnx16hw5hcgmadgywa7vnzg7gipjkr0gmd5"))
3829 (modules '((guix build utils)))
3830 (snippet
3831 '(begin
3832 (for-each delete-file-recursively
3833 ;; Remove bundled lua, pcap, and pcre libraries.
3834 ;; FIXME: Remove bundled liblinear once packaged.
3835 '("liblua"
3836 "libpcap"
3837 "libpcre"
3838 ;; Remove pre-compiled binares.
3839 "mswin32"))))))
3840 (build-system gnu-build-system)
3841 (outputs '("out" "ndiff")) ; TODO Add zenmap output
3842 (arguments
3843 (list
3844 #:configure-flags #~(list "--without-zenmap")
3845 #:phases
3846 #~(modify-phases %standard-phases
3847 (add-after 'unpack 'patch-Makefile.in
3848 (lambda _
3849 (substitute* "Makefile.in"
3850 (("\\$\\(PYTHON\\) -m build \\$\\(NDIFFDIR\\)/")
3851 "$(PYTHON) -m build --wheel --no-isolation $(NDIFFDIR)/")
3852 (("\\$\\(PYTHON\\) -m pip install \\$\\(NDIFFDIR\\).*")
3853 (string-append "pip"
3854 " --no-cache-dir"
3855 " --no-input"
3856 " install"
3857 " --no-build-isolation"
3858 " --no-deps"
3859 " --prefix"
3860 " $(prefix)"
3861 " $(NDIFFDIR)/\n")))))
3862 (replace 'install
3863 (lambda* (#:key inputs outputs #:allow-other-keys)
3864 (define (make out . args)
3865 (apply invoke "make"
3866 (string-append "PYTHON="
3867 (search-input-file inputs "/bin/python"))
3868 (string-append "CC=" #$(cc-for-target))
3869 (string-append "prefix=" out)
3870 args))
3871 (define (python-path dir)
3872 (string-append dir "/lib/python"
3873 #$(version-major+minor
3874 (package-version python))
3875 "/site-packages"))
3876 (let ((ndiff (assoc-ref outputs "ndiff")))
3877 (for-each mkdir-p (list #$output ndiff))
3878 (make #$output
3879 "install-nmap"
3880 "install-nse"
3881 "install-ncat"
3882 "install-nping")
3883 (make ndiff "install-ndiff")
3884 (wrap-program (string-append ndiff "/bin/ndiff")
3885 `("GUIX_PYTHONPATH" prefix
3886 (,(python-path ndiff)))))))
3887 (add-before 'check 'fix-tests-for-python-3.12
3888 (lambda _
3889 (substitute* "ndiff/ndifftest.py"
3890 (("import imp")
3891 "import importlib.util")
3892 (("ndiff = imp\\.load_source\\(\"ndiff\", \"ndiff\\.py\"\\)")
3893 (string-join
3894 '("spec = \
3895importlib.util.spec_from_file_location(\"ndiff\", \"ndiff.py\")"
3896 "ndiff = importlib.util.module_from_spec(spec)"
3897 "spec.loader.exec_module(ndiff)")
3898 "\n")))))
3899 ;; These are the tests that do not require network access.
3900 (replace 'check
3901 (lambda* (#:key tests? #:allow-other-keys)
3902 (when tests?
3903 (invoke "make"
3904 "check-nse"
3905 "check-ndiff")))))
3906 ;; Nmap can't cope with out-of-source building.
3907 #:out-of-source? #f))
3908 (native-inputs (list python-pypa-build python-setuptools python-wheel))
3909 (inputs
3910 (list bash-minimal ;for wrap-program
3911 libpcap
3912 lua-5.4
3913 openssl
3914 pcre2
3915 zlib ; for NSE compression
3916 perl
3917 python-wrapper)) ; for ndiff
3918 (home-page "https://nmap.org/")
3919 (synopsis "Network discovery and security auditing tool")
3920 (description
3921 "Nmap (\"Network Mapper\") is a network discovery and security auditing
3922tool. It is also useful for tasks such as network inventory, managing service
3923upgrade schedules, and monitoring host or service uptime. It also provides an
3924advanced netcat implementation (ncat), a utility for comparing scan
3925results (ndiff), and a packet generation and response analysis tool (nping).")
3926 ;; See <https://github.com/nmap/nmap/issues/2199#issuecomment-1380592744>.
3927 ;; This package uses nmap's bundled versions of libdnet and liblinear, which
3928 ;; both use a 3-clause BSD license.
3929 (license (list license:nmap license:bsd-3))))
3930
3931(define-public dstat
3932 (package
3933 (name "dstat")
3934 (version "0.7.4")
3935 (source
3936 (origin
3937 (method git-fetch)
3938 (uri (git-reference
3939 (url "https://github.com/dstat-real/dstat")
3940 (commit (string-append "v" version))))
3941 (file-name (git-file-name "dstat" version))
3942 (sha256
3943 (base32 "1qnmkhqmjd1m3if05jj29dvr5hn6kayq9bkkkh881w472c0zhp8v"))
3944 (patches (search-patches "dstat-fix-crash-when-specifying-delay.patch"
3945 "dstat-skip-devices-without-io.patch"))))
3946 (build-system gnu-build-system)
3947 (arguments
3948 (list
3949 #:tests? #f ; no make check
3950 #:make-flags
3951 #~(list (string-append "prefix=" #$output))
3952 #:phases
3953 #~(modify-phases %standard-phases
3954 (add-after 'unpack 'fix-python3-DeprecationWarning
3955 (lambda _
3956 (substitute* "dstat"
3957 (("collections") "collections.abc"))))
3958 (delete 'configure) ; no configure script
3959 (add-after 'install 'wrap
3960 (lambda _
3961 (wrap-program (string-append #$output "/bin/dstat")
3962 `("GUIX_PYTHONPATH" ":" prefix
3963 (,(getenv "GUIX_PYTHONPATH")))))))))
3964 (inputs
3965 (list bash-minimal ;for wrap-program
3966 python-wrapper
3967 python-six))
3968 (synopsis "Versatile resource statistics tool")
3969 (description "Dstat is a versatile replacement for @command{vmstat},
3970@command{iostat}, @command{netstat}, and @command{ifstat}. Dstat overcomes
3971some of their limitations and adds some extra features, more counters and
3972flexibility. Dstat is handy for monitoring systems during performance tuning
3973tests, benchmarks or troubleshooting.
3974
3975Dstat allows you to view all of your system resources in real-time, you can,
3976e.g., compare disk utilization in combination with interrupts from your IDE
3977controller, or compare the network bandwidth numbers directly with the disk
3978throughput (in the same interval).")
3979 (home-page "http://dag.wiee.rs/home-made/dstat/")
3980 (license license:gpl2+)))
3981
3982(define-public dool
3983 (package
3984 (name "dool")
3985 (version "1.3.8")
3986 (source
3987 (origin
3988 (method git-fetch)
3989 (uri (git-reference
3990 (url "https://github.com/scottchiefbaker/dool")
3991 (commit (string-append "v" version))))
3992 (file-name (git-file-name name version))
3993 (sha256
3994 (base32 "17fqrd6kvsfzgh5z8vkkk2n2fysj9zdwbdgd85l7n2q0qnzri0b8"))))
3995 (build-system pyproject-build-system)
3996 (arguments
3997 (list
3998 #:phases
3999 #~(modify-phases %standard-phases
4000 (add-after 'unpack 'remove-symlinks-and-snap-packaging
4001 ;; Remove symlinks that make 'ensure-no-mtimes-pre-1980 fail.
4002 (lambda _
4003 (delete-file-recursively "packaging/snap")))
4004 (delete 'build)
4005 (replace 'install
4006 (lambda _
4007 (substitute* "install.py"
4008 (("(bin_dir *= ?).*" _ prefix)
4009 (string-append prefix "\"" #$output "/bin/\"\n"))
4010 (("(plugin_dir *= ?).*" _ prefix)
4011 (string-append prefix "\"" #$output "/share/dool/\"\n"))
4012 (("(manpage_dir *= ?).*" _ prefix)
4013 (string-append prefix "\"" #$output "/share/man/man1/\"\n")))
4014 (invoke "python" "install.py" "--root")))
4015 (replace 'check
4016 (lambda* (#:key tests? #:allow-other-keys)
4017 (when tests?
4018 (invoke "./dool" "--version")
4019 (invoke "./dool" "-ta" "1" "5")))))))
4020 (synopsis "Command line system resource monitoring tool")
4021 (description "Dool is a command line tool to monitor many aspects of your
4022system: CPU, Memory, Network, Load Average, etc. It also includes a robust
4023plug-in architecture to allow monitoring other system metrics.")
4024 (home-page "https://github.com/scottchiefbaker/dool")
4025 (license license:gpl2+)))
4026
4027(define-public di
4028 (package
4029 (name "di")
4030 (version "4.53")
4031 (source
4032 (origin
4033 (method url-fetch)
4034 (uri (string-append "mirror://sourceforge/diskinfo-di/"
4035 "di-" version ".tar.gz"))
4036 (sha256
4037 (base32 "0gp806m7jk2rfymy5r62a2lfd8jq879qy94blrjqvb0xq7pmpp80"))))
4038 (build-system gnu-build-system)
4039 (arguments
4040 (list
4041 #:tests? #f ; obscure test failures
4042 #:phases
4043 #~(modify-phases %standard-phases
4044 (delete 'configure) ; no configure script
4045 (add-before 'build 'override-environment
4046 (lambda _
4047 (setenv "CC" #$(cc-for-target))
4048 (setenv "prefix" #$output))))
4049 #:make-flags
4050 #~(list "--environment-overrides")))
4051 (home-page "https://gentoo.com/di/")
4052 (synopsis "Advanced df like disk information utility")
4053 (description
4054 "@code{di} is a disk information utility, displaying everything that your
4055@code{df} command does and more. It features the ability to display your disk
4056usage in whatever format you prefer. It is designed to be highly portable and
4057produce uniform output across heterogeneous networks.")
4058 (license license:zlib)))
4059
4060(define-public cbatticon
4061 (package
4062 (name "cbatticon")
4063 (version "1.6.13")
4064 (source
4065 (origin
4066 (method git-fetch)
4067 (uri (git-reference
4068 (url "https://github.com/valr/cbatticon")
4069 (commit version)))
4070 (sha256
4071 (base32 "1xs37xrycvk0021r5l3xs4ijgf3lm25d2zhm8dppb5kx66xcj22m"))
4072 (file-name (git-file-name name version))))
4073 (build-system gnu-build-system)
4074 (arguments
4075 `(#:tests? #f ; no tests
4076 #:make-flags
4077 (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
4078 ,(string-append "CC=" (cc-for-target)))
4079 #:phases
4080 (modify-phases %standard-phases
4081 (delete 'configure)))) ; no configure script
4082 (inputs
4083 `(("gtk+" ,gtk+)
4084 ("gettext" ,gettext-minimal)
4085 ("libnotify" ,libnotify)))
4086 (native-inputs
4087 (list pkg-config))
4088 (synopsis "Lightweight battery icon for the system tray")
4089 (description "cbatticon is a lightweight battery icon that displays
4090the status of your battery in the system tray.")
4091 (home-page "https://github.com/valr/cbatticon")
4092 (license license:gpl2+)))
4093
4094(define-public pam-hooks
4095 (package
4096 (name "pam-hooks")
4097 (version "0.2.0")
4098 (source
4099 (origin
4100 (method url-fetch)
4101 (uri (string-append "https://upsilon.cc/~zack/hacking/software/"
4102 name "/" name "_" version ".tar.gz"))
4103 (sha256
4104 (base32 "102azxhvs53akkhgg2dkqg8m0jd6804fx8v7gq7pp03qm3m7bhqi"))))
4105 (build-system gnu-build-system)
4106 (arguments
4107 (list #:make-flags #~`("CC=gcc"
4108 ,(string-append "DESTDIR=" #$output))
4109 #:phases #~(modify-phases %standard-phases
4110 (delete 'configure))
4111 ;; There is a test directory, but it's unclear how to run them.
4112 #:tests? #f))
4113 (inputs (list linux-pam))
4114 (home-page "https://upsilon.cc/~zack/hacking/software/pam-hooks/")
4115 (synopsis "Linux-PAM module for login/logout hooks")
4116 (description "@code{pam-hooks} is a tiny PAM module enabling the
4117execution of hook scripts when a PAM session is opened or closed. The
4118typical use case is the need of doing some per-user set-up when a user
4119logs via a PAM-aware login mechanism and/or the need of doing some
4120per-user clean-up when the user logs out.")
4121 (license license:gpl3+)))
4122
4123(define-public pam-krb5
4124 (package
4125 (name "pam-krb5")
4126 (version "4.11")
4127 (source (origin
4128 (method url-fetch)
4129 (uri
4130 (list (string-append
4131 "https://archives.eyrie.org/software/kerberos/"
4132 "pam-krb5-" version ".tar.xz")
4133 (string-append
4134 "https://archives.eyrie.org/software/ARCHIVE/"
4135 "pam-krb5/pam-krb5-" version ".tar.xz")))
4136 (sha256
4137 (base32
4138 "1a16506j35475mps9v3srh54fxcdvypw5gjlmf9vdbwrpykns998"))))
4139 (build-system gnu-build-system)
4140 (arguments
4141 (list
4142 #:phases
4143 #~(modify-phases %standard-phases
4144 (add-before 'configure 'disable-tests
4145 (lambda _
4146 ;; The build container seems to interfere with some tests.
4147 (substitute* "tests/TESTS"
4148 (("module/basic +valgrind\n") ""))
4149 (substitute* "tests/TESTS"
4150 (("module/long +valgrind\n") ""))
4151 (substitute* "tests/TESTS"
4152 (("pam-util/vector +valgrind\n") "")))))))
4153 (inputs
4154 (list linux-pam mit-krb5))
4155 (native-inputs
4156 (list perl perl-test-pod)) ; required for tests
4157 (synopsis "Kerberos PAM module")
4158 (description
4159 "Pam-krb5 is a Kerberos PAM module for either MIT Kerberos or Heimdal.
4160It supports ticket refreshing by screen savers, configurable
4161authorization handling, authentication of non-local accounts for network
4162services, password changing, and password expiration, as well as all the
4163standard expected PAM features. It works correctly with OpenSSH, even
4164with @code{ChallengeResponseAuthentication} and @code{PrivilegeSeparation}
4165enabled, and supports extensive configuration either by PAM options or in
4166krb5.conf or both. PKINIT is supported with recent versions of both MIT
4167Kerberos and Heimdal and FAST is supported with recent MIT Kerberos.")
4168 (home-page "https://www.eyrie.org/~eagle/software/pam-krb5/")
4169 ;; Dual licenced under a homebrew non-copyleft OR GPL (any version)
4170 ;; However, the tarball does not contain a copy of the GPL, so unless
4171 ;; we put one in, we cannot distribute it under GPL without violating
4172 ;; clause requiring us to give all recipients a copy.
4173 (license license:gpl1+)))
4174
4175(define (sunxi-tools-source version)
4176 (origin
4177 (method git-fetch)
4178 (uri (git-reference
4179 (url "https://github.com/linux-sunxi/sunxi-tools")
4180 (commit (string-append "v" version))))
4181 (sha256
4182 (base32 "04f3jqg8ww4jxsf9c6ddcdgy2xbhkyp0b3l5f1hvvbv94p81rjxd"))
4183 (patches
4184 (search-patches "sunxi-tools-remove-sys-io.patch"))
4185 (modules '((guix build utils)))
4186 (snippet
4187 ;; Remove binaries contained in the tarball which are only for the
4188 ;; target and can be regenerated anyway.
4189 '(begin
4190 (delete-file-recursively "bin")
4191 #t))
4192 (file-name (git-file-name "sunxi-tools" version))))
4193
4194(define sunxi-target-tools
4195 (package
4196 (name "sunxi-target-tools")
4197 (version "1.4.2")
4198 (build-system gnu-build-system)
4199 (source
4200 (sunxi-tools-source version))
4201 (arguments
4202 `(#:system "armhf-linux"
4203 #:tests? #f
4204 #:make-flags (list (string-append "PREFIX="
4205 (assoc-ref %outputs "out"))
4206 (string-append "CROSS_COMPILE=")
4207 "CC=gcc")
4208 #:phases
4209 (modify-phases %standard-phases
4210 (delete 'configure)
4211 (replace 'build
4212 (lambda* (#:key make-flags #:allow-other-keys)
4213 (apply invoke "make" "target-tools" make-flags)))
4214 (replace 'install
4215 (lambda* (#:key make-flags #:allow-other-keys)
4216 (apply invoke "make" "install-target-tools"
4217 make-flags))))))
4218 (home-page "https://github.com/linux-sunxi/sunxi-tools")
4219 (synopsis "Hardware management tools for Allwinner computers")
4220 (description "This package contains tools for Allwinner devices:
4221@enumerate
4222@item @command{sunxi-meminfo}: Prints memory bus settings.
4223@end enumerate")
4224 (license license:gpl2+)))
4225
4226(define-public sunxi-tools
4227 (package
4228 (name "sunxi-tools")
4229 (version "1.4.2")
4230 (source
4231 (sunxi-tools-source version))
4232 (native-inputs
4233 (list sunxi-target-tools pkg-config))
4234 (inputs
4235 (list libusb))
4236 (build-system gnu-build-system)
4237 (arguments
4238 `(#:tests? #f ; no tests exist
4239 #:make-flags (list (string-append "PREFIX="
4240 (assoc-ref %outputs "out"))
4241 (string-append "CROSS_COMPILE=disabled")
4242 "CC=gcc")
4243 #:phases
4244 (modify-phases %standard-phases
4245 (delete 'configure)
4246 (replace 'build
4247 (lambda* (#:key make-flags #:allow-other-keys)
4248 (apply invoke "make" "tools" "misc" make-flags)))
4249 (replace 'install
4250 (lambda* (#:key inputs outputs make-flags #:allow-other-keys)
4251 ;; Those tools have been built for armhf but are part of the
4252 ;; installation in the upstream package. So do the same
4253 ;; here.
4254 (copy-recursively (assoc-ref inputs "sunxi-target-tools")
4255 (assoc-ref outputs "out"))
4256 (apply invoke "make" "install-tools" "install-misc"
4257 make-flags))))))
4258 (home-page "https://github.com/linux-sunxi/sunxi-tools")
4259 (synopsis "Hardware management tools for Allwinner computers")
4260 (description "This package contains tools for Allwinner devices:
4261@enumerate
4262@item @command{sunxi-fexc}, @command{bin2fex}, @command{fex2bin}: Compile
4263a textual description of a board (.fex) to a binary representation (.bin).
4264@item @command{sunxi-fel}: Puts an Allwinner device into FEL mode which
4265makes it register as a special USB device (rather than USB host).
4266You can then connect it to another computer and flash it from there.
4267@item @command{sunxi-nand-part}: Partitions NAND flash.
4268@item @command{sunxi-bootinfo}: Reads out boot0 and boot1 (Allwinner
4269bootloader) parameters.
4270@item @command{sunxi-pio}: Sets GPIO parameters and oscillates a GPIO
4271in order to be able to find it.
4272@item @command{sunxi-meminfo}: Prints memory bus settings.
4273@item @command{sunxi-nand-image-builder}: Prepares raw NAND images.
4274@end enumerate")
4275 (license license:gpl2+)))
4276
4277(define-public sedsed
4278 (package
4279 (name "sedsed")
4280 (version "2.0.0")
4281 (source
4282 (origin
4283 (method git-fetch)
4284 (uri (git-reference
4285 (url "https://github.com/aureliojargas/sedsed")
4286 (commit (string-append "v" version))))
4287 (file-name (git-file-name name version))
4288 (sha256
4289 (base32 "0sy26d60j89fw4z2bfvc7zblb7r1ras5q7f06gaqfg2058z5wj8m"))))
4290 (build-system pyproject-build-system)
4291 (arguments
4292 (list
4293 #:tests? #f ; XXX: test suit requires git set up, run by "./test/run"
4294 #:phases
4295 #~(modify-phases %standard-phases
4296 (add-after 'unpack 'patch-sed-in
4297 (lambda _
4298 (substitute* "sedsed.py"
4299 (("sedbin = 'sed'")
4300 (string-append "sedbin = '" (which "sed") "'")))))
4301 (delete 'build)
4302 (replace 'install
4303 (lambda _
4304 (let ((bin (string-append #$output "/bin")))
4305 ;; Just one file to copy around
4306 (install-file "sedsed.py" bin))))
4307 (add-after 'wrap 'symlink
4308 ;; Create 'sedsed' symlink to "sedsed.py".
4309 (lambda _
4310 (let* ((bin (string-append #$output "/bin"))
4311 (sed (string-append bin "/sedsed"))
4312 (sedpy (string-append bin "/sedsed.py")))
4313 (symlink sedpy sed)))))))
4314 (native-inputs
4315 (list python-setuptools
4316 python-wheel))
4317 (home-page "https://aurelio.net/projects/sedsed")
4318 (synopsis "Sed sed scripts")
4319 (description
4320 "@code{sedsed} can debug, indent, tokenize and HTMLize your @command{sed}
4321script.
4322
4323In debug mode, it reads your script and adds extra commands to it. When
4324executed you can see the data flow between the commands, revealing all the
4325magic sed performs on its internal buffers.
4326
4327In indent mode, your script is reformatted with standard spacing.
4328
4329In tokenize mode, you can see the elements of every command you use.
4330
4331In HTMLize mode, your script is converted to a beautiful colored HTML file,
4332with all the commands and parameters identified for your viewing pleasure.
4333
4334With sedsed you can master any sed script. No more secrets, no more hidden
4335buffers.")
4336 (license license:expat)))
4337
4338(define-public igt-gpu-tools
4339 (package
4340 (name "igt-gpu-tools")
4341 (version "2.4")
4342 (source
4343 (origin
4344 (method git-fetch)
4345 (uri (git-reference
4346 (url "https://gitlab.freedesktop.org/drm/igt-gpu-tools.git")
4347 (commit (string-append "v" version))))
4348 (file-name (git-file-name name version))
4349 (sha256
4350 (base32 "0ijvfa5wamihzbl8l29sc27ml0kmgzlld83jm5mln6bb4bvny4gs"))))
4351 (build-system meson-build-system)
4352 (arguments
4353 `(#:tests? #f ; many of the tests try to load kernel modules
4354 #:phases
4355 (modify-phases %standard-phases
4356 (add-after 'unpack 'find-rst2man.py
4357 (lambda _
4358 (substitute* "man/meson.build"
4359 (("'rst2man'") "'rst2man.py'")))))))
4360 (inputs
4361 (list cairo
4362 elfutils ; libdw
4363 eudev
4364 kmod
4365 libdrm
4366 libpciaccess
4367 libunwind
4368 pciutils
4369 procps
4370 python))
4371 (native-inputs
4372 (list bison flex pkg-config python-docutils))
4373 (home-page "https://gitlab.freedesktop.org/drm/igt-gpu-tools")
4374 (synopsis "Tools for development and testing of the Intel DRM driver")
4375 (description "IGT GPU Tools is a collection of tools for development and
4376testing of the Intel DRM driver. There are many macro-level test suites that
4377get used against the driver, including xtest, rendercheck, piglit, and
4378oglconform, but failures from those can be difficult to track down to kernel
4379changes, and many require complicated build procedures or specific testing
4380environments to get useful results. Therefore, IGT GPU Tools includes
4381low-level tools and tests specifically for development and testing of the
4382Intel DRM Driver.")
4383 (supported-systems '("i686-linux" "x86_64-linux"))
4384 (license license:expat)))
4385
4386(define-public neofetch
4387 (package
4388 (name "neofetch")
4389 (version "7.1.0")
4390 (source (origin
4391 (method git-fetch)
4392 (uri (git-reference
4393 (url "https://github.com/dylanaraps/neofetch")
4394 (commit version)))
4395 (file-name (git-file-name name version))
4396 (sha256
4397 (base32
4398 "0i7wpisipwzk0j62pzaigbiq42y1mn4sbraz4my2jlz6ahwf00kv"))))
4399 (build-system gnu-build-system)
4400 (arguments
4401 (list #:tests? #f ; there are no tests
4402 #:make-flags
4403 #~(list (string-append "PREFIX=" #$output))
4404 #:phases
4405 #~(modify-phases %standard-phases
4406 (delete 'configure)))) ; no configure script
4407 (home-page "https://github.com/dylanaraps/neofetch")
4408 (synopsis "System information script")
4409 (description "Neofetch is a command-line system information tool written in
4410Bash. Neofetch displays information about your system next to an image, your OS
4411logo, or any ASCII file of your choice. The main purpose of Neofetch is to be
4412used in screenshots to show other users what operating system or distribution
4413you are running, what theme or icon set you are using, etc.")
4414 (license license:expat)))
4415
4416(define-public hyfetch
4417 (package
4418 (name "hyfetch")
4419 (version "2.0.5")
4420 (source
4421 (origin
4422 (method git-fetch)
4423 (uri (git-reference
4424 (url "https://github.com/hykilpikonna/hyfetch")
4425 (commit version)))
4426 (file-name (git-file-name name version))
4427 (sha256
4428 (base32 "1xb0m7mna6mm3gc823c40rfdhnw39afdr3g7kb4cqrc21s7fdd5y"))))
4429 (build-system pyproject-build-system)
4430 (native-inputs
4431 (list python-hatchling
4432 python-pytest))
4433 (inputs
4434 (list python-typing-extensions))
4435 (home-page "https://github.com/hykilpikonna/HyFetch")
4436 (synopsis "@code{neofetch} with pride flags <3")
4437 (description "HyFetch is a command-line system information tool fork of
4438@code{neofetch}. HyFetch displays information about your system next to your
4439OS logo in ASCII representation. The ASCII representation is then colored in
4440the pattern of the pride flag of your choice. The main purpose of HyFetch is to
4441be used in screenshots to show other users what operating system or distribution
4442you are running, what theme or icon set you are using, etc.")
4443 (license license:expat)))
4444
4445(define-public uwufetch
4446 (package
4447 (name "uwufetch")
4448 (version "2.1")
4449 (source (origin
4450 (method git-fetch)
4451 (uri (git-reference
4452 (url "https://github.com/TheDarkBug/uwufetch")
4453 (commit version)))
4454 (file-name (git-file-name name version))
4455 (sha256
4456 (base32
4457 "182jwkm4vacz2bhyn7v4jl9bxs7md51az958r0qfp9ky71m2q3vh"))))
4458 (build-system gnu-build-system)
4459 (arguments
4460 (list
4461 #:tests? #f ;no tests
4462 #:make-flags
4463 #~(list (string-append "DESTDIR=" #$output)
4464 (string-append "ETC_DIR=" #$output "/etc")
4465 (string-append "CC=" #$(cc-for-target)))
4466 #:phases
4467 #~(modify-phases %standard-phases
4468 (delete 'configure)
4469 (add-before 'build 'patch-source-paths
4470 (lambda* (#:key inputs #:allow-other-keys)
4471 (let ((grep (search-input-file inputs "/bin/grep"))
4472 (awk (search-input-file inputs "/bin/awk")))
4473 (substitute* "fetch.c"
4474 (("grep") grep)
4475 (("awk") awk))
4476 (substitute* "uwufetch.c"
4477 (("(/usr(/local)?)(.*;)" all _ _ rest)
4478 (string-append #$output rest))))))
4479 ;; TODO this will be fixed in the next release of uwufetch
4480 (add-before 'install 'make-include-dir
4481 (lambda _
4482 (mkdir-p (string-append #$output "/include")))))))
4483 (inputs (list lshw
4484 gawk
4485 grep
4486 ;; viu XXX not yet packaged in Guix
4487 xwininfo))
4488 (home-page "https://github.com/TheDarkBug/uwufetch")
4489 (synopsis "Meme system info tool based on Nyan/UwU trend")
4490 (description
4491 "UwUFetch is a system information tool in the lineage of NeoFetch,
4492PFetch, HyFetch, and the like. It prints ASCII art of your system's logo as
4493well as a summary of system information. UwUFetch's unique contribution is the
4494uwu-ification of various words used in the description. For example, Guix
4495becomes gUwUix.")
4496 (license license:gpl3+)))
4497
4498(define-public screenfetch
4499 (package
4500 (name "screenfetch")
4501 (version "3.9.9")
4502 (source (origin
4503 (method git-fetch)
4504 (uri (git-reference
4505 (url "https://github.com/KittyKatt/screenFetch")
4506 (commit (string-append "v" version))))
4507 (file-name (git-file-name name version))
4508 (sha256
4509 (base32
4510 "0fly580235wmrqxgpf2mlblj587q05mikpsgaw1qq7z1nl44rmjh"))))
4511 (build-system trivial-build-system)
4512 (arguments
4513 `(#:modules ((guix build utils))
4514 #:builder
4515 (begin
4516 (use-modules (guix build utils))
4517 (let ((source (assoc-ref %build-inputs "source"))
4518 (out (assoc-ref %outputs "out")))
4519 (mkdir-p (string-append out "/bin/"))
4520 (copy-file (string-append source "/screenfetch-dev")
4521 (string-append out "/bin/screenfetch"))
4522 (install-file (string-append source "/screenfetch.1")
4523 (string-append out "/man/man1/"))
4524 (install-file (string-append source "/COPYING")
4525 (string-append out "/share/doc/" ,name "-" ,version))
4526 (substitute* (string-append out "/bin/screenfetch")
4527 (("/usr/bin/env bash")
4528 (search-input-file %build-inputs "/bin/bash")))
4529 (wrap-program
4530 (string-append out "/bin/screenfetch")
4531 `("PATH" ":" prefix
4532 (,(string-append (assoc-ref %build-inputs "bc") "/bin:"
4533 (assoc-ref %build-inputs "scrot") "/bin:"
4534 (assoc-ref %build-inputs "xdpyinfo") "/bin"
4535 (assoc-ref %build-inputs "xprop") "/bin"))))
4536 (substitute* (string-append out "/bin/screenfetch")
4537 (("#!#f")
4538 (string-append "#!"
4539 (search-input-file %build-inputs
4540 "/bin/bash"))))))))
4541 (inputs
4542 (list bash bc scrot xdpyinfo xprop))
4543 (home-page "https://github.com/KittyKatt/screenFetch")
4544 (synopsis "System information script")
4545 (description "Bash screenshot information tool which can be used to
4546generate those nifty terminal theme information and ASCII distribution logos in
4547everyone's screenshots nowadays.")
4548 (license license:gpl3)))
4549
4550(define-public ufetch
4551 (package
4552 (name "ufetch")
4553 (version "0.4")
4554 (source (origin
4555 (method git-fetch)
4556 (uri (git-reference
4557 (url "https://gitlab.com/jschx/ufetch.git")
4558 (commit (string-append "v" version))))
4559 (file-name (git-file-name name version))
4560 (sha256
4561 (base32
4562 "0858hq9lannyh4ipvrlk3syc576r2x6f6hr08n0hfsn3x3ndzjl9"))))
4563 (build-system trivial-build-system)
4564 (inputs
4565 `(("bash" ,bash)
4566 ("tput" ,ncurses)))
4567 (arguments
4568 `(#:modules ((guix build utils))
4569 #:builder
4570 (begin
4571 (use-modules (guix build utils))
4572 (let* ((source (assoc-ref %build-inputs "source"))
4573 (output (assoc-ref %outputs "out"))
4574 (bindir (string-append output "/bin"))
4575 (docdir (string-append output "/share/doc/ufetch-" ,version))
4576 (tput (search-input-file %build-inputs "/bin/tput")))
4577 (install-file (string-append source "/LICENSE") docdir)
4578 (setenv "PATH" (string-append (assoc-ref %build-inputs "bash") "/bin"))
4579 (mkdir-p bindir)
4580 (for-each (lambda (src)
4581 (let ((dst (string-append bindir "/" (basename src))))
4582 (copy-file src dst)
4583 (patch-shebang dst)
4584 (substitute* dst (("tput") tput))))
4585 (find-files source "ufetch-[[:alpha:]]*$"))
4586 ;; Note: the `ufetch` we create below will only work if run under
4587 ;; the Guix System. I.e. a user trying to run `ufetch` on a
4588 ;; foreign distro will not get great results. The `screenfetch`
4589 ;; program does actual runtime detection of the operating system,
4590 ;; and would be a better choice in such a situation.
4591 (symlink "ufetch-guix" (string-append bindir "/ufetch"))))))
4592 (home-page "https://gitlab.com/jschx/ufetch")
4593 (synopsis "Tiny system info")
4594 (description "This package provides a tiny system info utility.")
4595 (license license:expat)))
4596
4597(define-public pfetch
4598 (let ((commit "a906ff89680c78cec9785f3ff49ca8b272a0f96b")
4599 (revision "1"))
4600 (package
4601 (name "pfetch")
4602 (version (git-version "0.7.0" revision commit))
4603 (source (origin
4604 (method git-fetch)
4605 (uri (git-reference
4606 (url "https://github.com/dylanaraps/pfetch")
4607 (commit commit)))
4608 (file-name (git-file-name name version))
4609 (sha256
4610 (base32
4611 "1yhf8mxjn58gjfdii3bpn8522gfaicd8jxjxvmwi2jz7fgvp0zpn"))))
4612 (build-system trivial-build-system)
4613 (inputs (list bash))
4614 (arguments
4615 `(#:modules ((guix build utils))
4616 #:builder
4617 (begin
4618 (use-modules (guix build utils))
4619 (let* ((source (lambda (f)
4620 (string-append (assoc-ref %build-inputs "source") "/" f)))
4621 (output (assoc-ref %outputs "out"))
4622 (docdir (string-append output "/share/doc/pfetch-" ,version)))
4623 (install-file (source "LICENSE.md") docdir)
4624 (install-file (source "README.md") docdir)
4625 (install-file (source "pfetch") (string-append output "/bin"))
4626 (patch-shebang
4627 (string-append output "/bin/pfetch")
4628 (list (string-append (assoc-ref %build-inputs "bash") "/bin")))))))
4629 (home-page "https://github.com/dylanaraps/pfetch")
4630 (synopsis "System information tool")
4631 (description "This package provides a simple, configurable system
4632information tool.")
4633 (license license:expat))))
4634
4635(define-public fastfetch-minimal
4636 (package
4637 (name "fastfetch-minimal")
4638 (version "2.66.0")
4639 (source
4640 (origin
4641 (method git-fetch)
4642 (uri (git-reference
4643 (url "https://github.com/fastfetch-cli/fastfetch")
4644 (commit version)))
4645 (file-name (git-file-name name version))
4646 (sha256
4647 (base32 "19a5dmn13pnjygwqhj4frd8q0r9k2yb2j63s331wrhijy4837nxn"))
4648 (modules '((guix build utils)))
4649 (snippet #~(delete-file-recursively "src/3rdparty"))))
4650 (build-system cmake-build-system)
4651 (arguments
4652 (list
4653 #:configure-flags #~(list "-DENABLE_SYSTEM_YYJSON=ON"
4654 "-DENABLE_WCWIDTH=OFF"
4655 "-DBUILD_FLASHFETCH=OFF"
4656 "-DBUILD_TESTS=ON"
4657 "-DINSTALL_LICENSE=OFF")))
4658 (inputs (list yyjson))
4659 (native-inputs (list pkg-config python-minimal))
4660 (home-page "https://github.com/fastfetch-cli/fastfetch")
4661 (synopsis "Display system information in a stylized manner")
4662 (description
4663 "Fastfetch is a tool for fetching system information and displaying it in
4664a stylized way. Fastfetch displays this information next to a logo of the
4665system distribution, akin to many similar tools.")
4666 (license license:expat)))
4667
4668(define-public fastfetch
4669 (package
4670 (inherit fastfetch-minimal)
4671 (name "fastfetch")
4672 (arguments
4673 (substitute-keyword-arguments arguments
4674 ((#:configure-flags flags #~'())
4675 #~(append #$flags
4676 (list "-DBINARY_LINK_TYPE=dynamic"
4677 "-DENABLE_DIRECTX_HEADERS=OFF"
4678 (string-append "-DCUSTOM_PCI_IDS_PATH="
4679 #$(this-package-input "hwdata")
4680 "/share/hwdata/pci.ids")
4681 (string-append "-DCUSTOM_AMDGPU_IDS_PATH="
4682 #$(this-package-input "libdrm")
4683 "/share/libdrm/amdgpu.ids"))))))
4684 (inputs
4685 (modify-inputs inputs
4686 (append dbus
4687 glib
4688 hwdata
4689 imagemagick
4690 libdrm
4691 libxcb
4692 mesa
4693 wayland
4694 zlib ;for imagemagick and an #ifdef
4695 zfs)))))
4696
4697(define-public nnn
4698 (package
4699 (name "nnn")
4700 (version "5.3")
4701 (source
4702 (origin
4703 (method url-fetch)
4704 (uri (string-append "https://github.com/jarun/nnn/releases/download/v"
4705 version "/nnn-v" version ".tar.gz"))
4706 (sha256
4707 (base32 "0vdv658izj6kxhhvhq940753mg00j3n2933y9bhgypma19yxa9n6"))))
4708 (build-system gnu-build-system)
4709 (inputs
4710 (list ncurses readline))
4711 (native-inputs
4712 (list pkg-config))
4713 (arguments
4714 (list #:tests? #f ; no tests
4715 #:make-flags
4716 #~(list
4717 (string-append "PREFIX=" #$output)
4718 (string-append "CC=" #$(cc-for-target))
4719 (string-append "PKG_CONFIG=" #$(pkg-config-for-target)))
4720 #:phases
4721 #~(modify-phases %standard-phases
4722 (delete 'configure)))) ; no configure script
4723 (home-page "https://github.com/jarun/nnn")
4724 (synopsis "Terminal file browser")
4725 (description
4726 "@command{nnn} is a fork of @command{noice}, a fast and minimal text
4727terminal file browser with keyboard shortcuts for navigation, opening files and
4728running tasks. There is no configuration file and MIME associations are
4729hard-coded.")
4730 (license license:bsd-2)))
4731
4732(define-public thermald
4733 (package
4734 (name "thermald")
4735 (version "2.5.12")
4736 (source
4737 (origin
4738 (method git-fetch)
4739 (uri (git-reference
4740 (url "https://github.com/intel/thermal_daemon")
4741 (commit (string-append "v" version))))
4742 (file-name (git-file-name name version))
4743 (sha256
4744 (base32 "1vwnigyygzch2pxszqbhs4vpjkzpc5pf0k7p5fxmsanmf5mp76m6"))))
4745 (build-system gnu-build-system)
4746 (arguments
4747 (list
4748 #:configure-flags
4749 #~(list (string-append "--with-dbus-sys-dir="
4750 #$output "/etc/dbus-1/system.d")
4751 "--localstatedir=/var"
4752 "--disable-werror")
4753 #:make-flags
4754 #~(list "V=1") ; log build commands
4755 #:phases
4756 #~(modify-phases %standard-phases
4757 (add-before 'bootstrap 'no-early-./configure
4758 (lambda _
4759 (setenv "NO_CONFIGURE" "yet"))))))
4760 (native-inputs
4761 (list autoconf
4762 autoconf-archive
4763 automake
4764 `(,glib "bin") ; for glib-genmarshal, etc.
4765 gtk-doc/stable
4766 pkg-config))
4767 (inputs
4768 (list dbus-glib libevdev libxml2 upower xz))
4769 (home-page "https://github.com/intel/thermal_daemon")
4770 (synopsis "CPU scaling for thermal management")
4771 (description "The Linux Thermal Daemon helps monitor and control temperature
4772on systems running the Linux kernel.")
4773 ;; arm and aarch64 don't have cpuid.h.
4774 (supported-systems '("i686-linux" "x86_64-linux"))
4775 (license license:gpl2)))
4776
4777(define-public tcptrack
4778 (package
4779 (name "tcptrack")
4780 (version "1.4.3")
4781 (source (origin
4782 (method git-fetch)
4783 (uri (git-reference
4784 (url "https://github.com/bchretien/tcptrack")
4785 (commit (string-append "v" version))))
4786 (file-name (git-file-name name version))
4787 (sha256
4788 (base32
4789 "08lh3l67wn4kq9q0nfspc7rj0jvp9dzwjgxpvqliwcif8cy5mi45"))))
4790 (build-system gnu-build-system)
4791 (inputs (list libpcap ncurses))
4792 (synopsis "TCP connections sniffer")
4793 (description
4794 "Tcptrack is a sniffer which displays information about TCP connections
4795it sees on a network interface. This is a fork of Steve Benson’s tcptrack.")
4796 (home-page "https://github.com/bchretien/tcptrack")
4797 (license license:lgpl2.1+)))
4798
4799(define-public masscan
4800 (package
4801 (name "masscan")
4802 (version "1.3.2")
4803 (source
4804 (origin
4805 (method git-fetch)
4806 (uri (git-reference
4807 (url "https://github.com/robertdavidgraham/masscan")
4808 (commit version)))
4809 (file-name (git-file-name name version))
4810 (sha256
4811 (base32 "1y0ka1y01afmzcad8rw4jgkmlc17yccc30wk8xldj00hdbz84wcs"))))
4812 (build-system gnu-build-system)
4813 (inputs
4814 (list libpcap))
4815 (arguments
4816 (list #:test-target "regress"
4817 #:make-flags
4818 #~(list (string-append "CC=" #$(cc-for-target))
4819 (string-append "PREFIX=" #$output))
4820 #:phases
4821 #~(modify-phases %standard-phases
4822 (delete 'configure) ; no ./configure script
4823 (add-after 'unpack 'patch-path
4824 (lambda* (#:key inputs #:allow-other-keys)
4825 (let ((pcap (assoc-ref inputs "libpcap")))
4826 (substitute* "src/stub-pcap.c"
4827 (("libpcap.so")
4828 (string-append pcap "/lib/libpcap.so")))))))))
4829 (synopsis "TCP port scanner")
4830 (description "MASSCAN is an asynchronous TCP port scanner. It can detect
4831open ports, and also complete the TCP connection and interact with the remote
4832application, collecting the information received.")
4833 (home-page "https://github.com/robertdavidgraham/masscan")
4834 ;; 'src/siphash24.c' is the SipHash reference implementation, which
4835 ;; bears a CC0 Public Domain Dedication.
4836 (license license:agpl3+)))
4837
4838(define-public launchmon
4839 (package
4840 (name "launchmon")
4841 (version "1.0.2")
4842 (source (origin
4843 (method url-fetch)
4844 (uri (string-append
4845 "https://github.com/LLNL/LaunchMON/releases/download/v"
4846 version "/launchmon-v" version ".tar.gz"))
4847 (sha256
4848 (base32
4849 "0fm3nd9mydm9v2bf7bh01dbgrfnpwkapxa3dsvy3x1z0rz61qc0x"))
4850 (modules '((guix build utils)))
4851 (snippet
4852 '(begin
4853 ;; Fix build failure with GCC 7 due to a conversion error.
4854 ;; Remove for versions > 1.0.2.
4855 (substitute* "launchmon/src/linux/lmon_api/lmon_coloc_spawner.cxx"
4856 ((" lmonpl = '\\\\0'")
4857 " *lmonpl = '\\0'"))
4858 #t))))
4859 (build-system gnu-build-system)
4860 (arguments
4861 ;; GCC 11 defaults to c++17 but this package needs something older.
4862 (list #:configure-flags #~'("CXXFLAGS=-std=c++14 -O2 -g")))
4863 (inputs
4864 (list openmpi
4865 munge
4866 boost
4867 libelf
4868 libgcrypt
4869 libgpg-error))
4870 (synopsis "Infrastructure for large-scale tool daemon launching")
4871 (description
4872 "LaunchMON is a software infrastructure that enables HPC run-time
4873tools to co-locate tool daemons with a parallel job. Its API allows a
4874tool to identify all the remote processes of a job and to scalably
4875launch daemons into the relevant nodes.")
4876 (home-page "https://github.com/LLNL/LaunchMON")
4877 (supported-systems '("i686-linux" "x86_64-linux"))
4878 (license license:lgpl2.1)))
4879
4880(define-public spindle
4881 (package
4882 (name "spindle")
4883 (version "0.13")
4884 (source (origin
4885 ;; We use git checkout to avoid github auto-generated tarballs
4886 (method git-fetch)
4887 (uri (git-reference
4888 (url "https://github.com/hpc/Spindle")
4889 (commit (string-append "v" version))))
4890 (file-name (git-file-name name version))
4891 (sha256
4892 (base32
4893 "1z594nhash1him9v00qmyqv9jvikzrs4wxqy1cvnfwqwnrrkp707"))))
4894 (build-system gnu-build-system)
4895 (arguments '(#:configure-flags '("--enable-sec-launchmon"
4896 "--enable-sec-munge"
4897 "--enable-sec-none"
4898 ;; Fails to build as c++17.
4899 "CXXFLAGS=-std=c++14 -O2 -g")))
4900 (inputs
4901 (list openmpi munge launchmon libgcrypt zlib))
4902 (synopsis "Scalable library loading in HPC environments")
4903 (description
4904 "Spindle is a tool for improving the performance of dynamic library and
4905Python loading in HPC environments.")
4906 (home-page "https://github.com/hpc/Spindle")
4907 ;; This package supports x86_64 and PowerPC64
4908 (supported-systems '("x86_64-linux"))
4909 (license license:lgpl2.1)))
4910
4911(define-public inxi-minimal
4912 (let ((real-name "inxi"))
4913 (package
4914 (name "inxi-minimal")
4915 (version "3.3.40-1")
4916 (source
4917 (origin
4918 (method git-fetch)
4919 (uri (git-reference
4920 (url "https://codeberg.org/smxi/inxi")
4921 (commit version)))
4922 (file-name (git-file-name real-name version))
4923 (sha256
4924 (base32 "0ivj0dcx7d2hmmkhyql156sb08385rzw640z9kyq4cv1n8ndz58s"))))
4925 (build-system trivial-build-system)
4926 (inputs
4927 (list bash-minimal
4928 perl
4929 procps))
4930 (native-inputs
4931 (list gzip))
4932 (arguments
4933 `(#:modules ((guix build utils))
4934 #:builder
4935 (begin
4936 (use-modules (guix build utils)
4937 (ice-9 match)
4938 (srfi srfi-26))
4939 (setenv "PATH" (string-join
4940 (map (lambda (file)
4941 (dirname (search-input-file %build-inputs
4942 file)))
4943 (list "bin/bash"
4944 "bin/gzip"
4945 "bin/perl"))
4946 ":"))
4947 (copy-recursively (assoc-ref %build-inputs "source")
4948 ,(string-append real-name "-" version))
4949 (with-directory-excursion ,(string-append real-name "-" version)
4950 (patch-shebang "inxi" (list (dirname (search-input-file
4951 %build-inputs "bin/perl"))))
4952 (let ((bin (string-append %output "/bin")))
4953 (install-file "inxi" bin)
4954 (wrap-program (string-append bin "/inxi")
4955 `("PATH" ":" =
4956 ("$PATH"
4957 ,@(map (lambda (input)
4958 (match input
4959 ((name . store)
4960 (let ((store-append
4961 (cut string-append store <>)))
4962 (cond
4963 ((member name '("util-linux"))
4964 (string-append (store-append "/bin") ":"
4965 (store-append "/sbin")))
4966 ((member name '("dmidecode" "iproute2" "lvm2"
4967 "mdadm"))
4968 (store-append "/sbin"))
4969 (else (store-append "/bin")))))))
4970 %build-inputs)))
4971 `("PERL5LIB" ":" =
4972 ,(delete
4973 ""
4974 (map (match-lambda
4975 (((? (cut string-prefix? "perl-" <>) name) . dir)
4976 (string-append dir "/lib/perl5/site_perl"))
4977 (_ ""))
4978 %build-inputs)))))
4979 (invoke "gzip" "-n" "inxi.1")
4980 (install-file "inxi.1.gz"
4981 (string-append %output "/share/man/man1"))))))
4982 (home-page "https://smxi.org/docs/inxi.htm")
4983 (synopsis "Full-featured system information script")
4984 (description "Inxi is a system information script that can display
4985various things about your hardware and software to users in an IRC chatroom or
4986support forum. It runs with the @code{/exec} command in most IRC clients.")
4987 (license license:gpl3+))))
4988
4989(define-public inxi
4990 (package
4991 (inherit inxi-minimal)
4992 (name "inxi")
4993 (inputs
4994 `(("dmidecode" ,dmidecode)
4995 ("eudev" ,eudev)
4996 ("file" ,file)
4997 ("bind:utils" ,isc-bind "utils") ; dig
4998 ("gzip" ,gzip)
4999 ("iproute2" ,iproute) ; ip
5000 ("kmod" ,kmod) ; modinfo
5001 ("lm-sensors" ,lm-sensors)
5002 ("mesa-utils" ,mesa-utils)
5003 ("pciutils" ,pciutils)
5004 ("tar" ,tar)
5005 ("tree" ,tree)
5006 ("util-linux" ,util-linux) ; lsblk
5007 ("usbutils" ,usbutils) ; lsusb
5008 ("wmctrl" ,wmctrl)
5009 ("xdpyinfo" ,xdpyinfo)
5010 ("xprop" ,xprop)
5011 ("xrandr" ,xrandr)
5012 ("coreutils" ,coreutils) ; uptime
5013 ("inetutils" ,inetutils) ; ifconfig
5014 ("perl-cpanel-json-xs" ,perl-cpanel-json-xs)
5015 ("perl-http-tiny" ,perl-http-tiny)
5016 ("perl-io-socket-ssl" ,perl-io-socket-ssl)
5017 ("perl-json-xs" ,perl-json-xs)
5018 ("perl-time-hires" ,perl-time-hires)
5019 ("lvm2" ,lvm2) ; lvs
5020 ("mdadm" ,mdadm)
5021 ("wayland-utils" ,wayland-utils)
5022 ;; TODO: Add more inputs:
5023 ;; ipmi-sensors
5024 ;; hddtemp
5025 ;; perl-xml-dumper
5026 ;; ipmitool
5027 ;; wlr-randr
5028 ;; vulkan-tools
5029 ,@(package-inputs inxi-minimal)))))
5030
5031(define-public pscircle
5032 (package
5033 (name "pscircle")
5034 (version "1.4.0")
5035 (source
5036 (origin
5037 (method git-fetch)
5038 (uri (git-reference
5039 (url "https://gitlab.com/mildlyparallel/pscircle")
5040 (commit (string-append "v" version))))
5041 (file-name (git-file-name name version))
5042 (sha256
5043 (base32 "0vdllrv2hxw71zhi1xrchkqvq0si4xas1qcsbqmgld8wvc2d19kf"))))
5044 (build-system meson-build-system)
5045 (native-inputs
5046 (list pkg-config))
5047 (inputs
5048 (list cairo libpng libx11))
5049 (home-page "https://gitlab.com/mildlyparallel/pscircle")
5050 (synopsis "Visualize Linux processes in a form of radial tree")
5051 (description
5052 "@code{pscircle} visualizes Linux processes in the form of a radial tree.")
5053 (license license:gpl2+)))
5054
5055(define-public python-pyudev
5056 (package
5057 (name "python-pyudev")
5058 (version "0.24.4")
5059 (source
5060 (origin
5061 (method git-fetch)
5062 (uri (git-reference
5063 (url "https://github.com/pyudev/pyudev")
5064 (commit (string-append "v" version))))
5065 (file-name (git-file-name name version))
5066 (sha256
5067 (base32
5068 "1m7xrsazbij5dcmnirn9hq6cwrfmzam5mr3kmvvcgnh24nhm401x"))))
5069 (build-system pyproject-build-system)
5070 (arguments
5071 (list
5072 ;; tests: 46 passed, 36 skipped, 79 deselected, 2 warnings
5073 #:test-flags
5074 ;; These tests actually try to read /sys/devices:
5075 #~(list "-k" (string-join
5076 (list "not test_action"
5077 "test_action_mock"
5078 "test_ancestors"
5079 "test_anything"
5080 "test_asbool"
5081 "test_asint"
5082 "test_asstring"
5083 "test_attributes"
5084 "test_contains_mock"
5085 "test_deprecated_handler"
5086 "test_device_node"
5087 "test_device_number"
5088 "test_device_ordering"
5089 "test_device_path"
5090 "test_device_sys_name"
5091 "test_driver"
5092 "test_equality"
5093 "test_fake"
5094 "test_fake_monitor"
5095 "test_find_parent_no_devtype_mock"
5096 "test_find_parent_with_devtype_mock"
5097 "test_from_device_file"
5098 "test_from_device_number"
5099 "test_from_device_number_wrong_type"
5100 "test_from_name"
5101 "test_from_name_no_device_in_existing_subsystem"
5102 "test_from_path"
5103 "test_from_path_strips_leading_slash"
5104 "test_from_sys_path"
5105 "test_getitem"
5106 "test_getitem"
5107 "test_getitem_nonexisting"
5108 "test_hash"
5109 "test_inequality"
5110 "test_is_initialized"
5111 "test_is_initialized_mock"
5112 "test_iteration"
5113 "test_iteration_mock"
5114 "test_key_subset"
5115 "test_length"
5116 "test_links"
5117 "test_match"
5118 "test_match_parent"
5119 "test_match_property_bool"
5120 "test_match_subsystem"
5121 "test_match_subsystem_nomatch_complete"
5122 "test_match_subsystem_nomatch_unfulfillable"
5123 "test_name"
5124 "test_non_iterable"
5125 "test_parent"
5126 "test_path"
5127 "test_sequence_number"
5128 "test_subsystem"
5129 "test_sys_number"
5130 "test_sys_path"
5131 "test_tags"
5132 "test_time_since_initialized"
5133 "test_time_since_initialized_mock"
5134 "test_traverse"
5135 "test_type"
5136 "test_unsetitem")
5137 " and not "))
5138 #:phases
5139 #~(modify-phases %standard-phases
5140 (add-after 'unpack 'patch-ctypes-udev
5141 (lambda* (#:key inputs #:allow-other-keys)
5142 (substitute* "src/pyudev/core.py"
5143 (("\"udev\"")
5144 (format #f "~s"
5145 (search-input-file inputs "/lib/libudev.so"))))
5146 (substitute* "src/pyudev/_ctypeslib/utils.py"
5147 ;; Use absolute paths instead of keys.
5148 (("= find_library") "= ")))))))
5149 (native-inputs
5150 (list python-pytest
5151 python-setuptools))
5152 (inputs
5153 (list eudev))
5154 (home-page "https://pyudev.readthedocs.io/")
5155 (synopsis "Python udev binding")
5156 (description "This package provides @code{udev} bindings for Python.")
5157 (license license:lgpl2.1)))
5158
5159(define-public undervolt
5160 (package
5161 (name "undervolt")
5162 (version "0.4.0")
5163 (source
5164 (origin
5165 (method git-fetch)
5166 (uri (git-reference
5167 (url "https://github.com/georgewhewell/undervolt")
5168 (commit version)))
5169 (file-name (git-file-name name version))
5170 (sha256
5171 (base32 "136j8rqqra84yg57vn3nqwk1b36y9y7sjkynr0fl8pnrb7z8mq0v"))))
5172 (build-system pyproject-build-system)
5173 (arguments
5174 (list #:tests? #f)) ;no tests
5175 (native-inputs
5176 (list python-setuptools))
5177 (home-page "https://github.com/georgewhewell/undervolt")
5178 (synopsis "Undervolt Intel CPUs under Linux")
5179 (description
5180 "Undervolt is a program for undervolting Intel CPUs under Linux. It
5181works in a similar manner to the Windows program ThrottleStop (i.e, MSR
51820x150). A fixed voltage offset may be applied to one of 5 voltage planes,
5183which overrides systems' temperature target (CPU will throttle when this
5184temperature is reached).")
5185 (license license:gpl2+)))
5186
5187(define-public vmtouch
5188 (package
5189 (name "vmtouch")
5190 (version "1.3.1")
5191 (source
5192 (origin
5193 (method git-fetch)
5194 (uri (git-reference
5195 (url "https://github.com/hoytech/vmtouch/")
5196 (commit (string-append "v" version))))
5197 (file-name (git-file-name name version))
5198 (sha256
5199 (base32 "08da6apzfkfjwasn4dxrlfxqfx7arl28apdzac5nvm0fhvws0dxk"))))
5200 (build-system gnu-build-system)
5201 (native-inputs
5202 (list perl))
5203 (arguments
5204 `(#:tests? #f ; no tests
5205 #:make-flags
5206 (list
5207 (string-append "CC=" ,(cc-for-target))
5208 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5209 #:phases
5210 (modify-phases %standard-phases
5211 (delete 'configure))))
5212 (home-page "https://github.com/hoytech/vmtouch/")
5213 (synopsis "Portable file system cache diagnostics and control")
5214 (description
5215 "vmtouch is a tool for learning about and controlling the file system
5216cache of unix and unix-like systems.")
5217 (license license:bsd-3)))
5218
5219(define-public solaar
5220 (package
5221 (name "solaar")
5222 (version "1.1.20")
5223 (source
5224 (origin
5225 (method git-fetch)
5226 (uri (git-reference
5227 (url "https://github.com/pwr-Solaar/Solaar")
5228 (commit version)))
5229 (file-name (git-file-name name version))
5230 (sha256
5231 (base32 "1a5n5js26ibsv0qc1nm71fyy945gxrqpb70xf852fcpd8k5s5yw7"))))
5232 (build-system pyproject-build-system)
5233 (arguments
5234 (list #:phases
5235 #~(modify-phases %standard-phases
5236 (replace 'wrap
5237 (lambda _
5238 (wrap-program (string-append #$output "/bin/solaar")
5239 `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))
5240 (native-inputs
5241 (list gobject-introspection
5242 python-pytest
5243 python-pytest-mock
5244 python-setuptools
5245 python-typing-extensions))
5246 (propagated-inputs
5247 (list python-pycairo
5248 python-pygobject
5249 python-pyudev
5250 python-dbus
5251 python-evdev
5252 ;; For GUI.
5253 python-pyyaml
5254 python-psutil
5255 python-typing-extensions
5256 python-xlib
5257 gtk+
5258 python-pygobject))
5259 (inputs (list bash-minimal libappindicator))
5260 (home-page "https://pwr-solaar.github.io/Solaar/")
5261 (synopsis "Linux devices manager for the Logitech Unifying Receiver")
5262 (description "This package provides tools to manage clients of the
5263Logitech Unifying Receiver.")
5264 (license license:gpl2)))
5265
5266(define-public lynis
5267 (package
5268 (name "lynis")
5269 ;; Also update the ‘lynis-sdk’ input to the commit matching this release.
5270 (version "3.1.1")
5271 (source
5272 (origin
5273 (method git-fetch)
5274 (uri (git-reference
5275 (url "https://github.com/CISOfy/lynis")
5276 (commit version)))
5277 (file-name (git-file-name name version))
5278 (sha256
5279 (base32 "05bh16i916xz9w8p8fz8flzj9ayyzg7wpbi7q61ylrlahhc03nqd"))
5280 (modules '((guix build utils)))
5281 (snippet
5282 '(begin
5283 ;; Remove proprietary plugins. As of now, all plugins supplied with
5284 ;; lynis are proprietary. In the future, if free plugins are
5285 ;; provided, whitelist them from deletion.
5286 (for-each delete-file (find-files "plugins"))))))
5287 (build-system gnu-build-system)
5288 (native-inputs
5289 `(;; For tests
5290 ("lynis-sdk"
5291 ,(origin
5292 (method git-fetch)
5293 (uri (git-reference
5294 (url "https://github.com/CISOfy/lynis-sdk")
5295 (commit "f4f885f1f049f59940487a6ffc2d53806c729d12")))
5296 (file-name (git-file-name "lynis-sdk" version))
5297 (sha256
5298 (base32 "09d98wmvan7nlchm056kls5xm939d1231pwsvlp4q2aznz8cmg42"))))))
5299 (arguments
5300 (list
5301 #:phases
5302 #~(modify-phases %standard-phases
5303 (replace 'unpack
5304 ;; XXX Remove after fixing <https://issues.guix.gnu.org/55287>.
5305 (lambda* (#:key source #:allow-other-keys)
5306 (mkdir "source")
5307 (chdir "source")
5308 (copy-recursively source "."
5309 #:keep-mtime? #t)))
5310 (replace 'configure
5311 (lambda _
5312 (substitute* "lynis"
5313 (("/usr/share/lynis")
5314 (string-append #$output "/share/lynis")))
5315 (substitute* "include/functions"
5316 (("/usr/local/etc/lynis")
5317 (string-append #$output "/etc/lynis")))))
5318 (delete 'build)
5319 (replace 'install
5320 (lambda _
5321 (install-file "lynis" (string-append #$output "/bin/"))
5322 (install-file "default.prf" (string-append #$output "/etc/lynis"))
5323 (for-each
5324 (lambda (dir)
5325 (copy-recursively
5326 dir (string-append #$output "/share/lynis/" dir)))
5327 (list "db" "include" "plugins"))
5328 (install-file "lynis.8"
5329 (string-append #$output "/share/man/man8"))))
5330 (replace 'check
5331 (lambda _
5332 (copy-recursively #$(this-package-native-input "lynis-sdk")
5333 "../lynis-sdk")
5334 (setenv "LANG" "en_US.UTF-8")
5335 (let ((lynis-dir (getcwd)))
5336 (with-directory-excursion "../lynis-sdk"
5337 (substitute* "config"
5338 (("\\.\\./lynis") lynis-dir))
5339 (substitute* "unit-tests/tests-language-translations.sh"
5340 (("\\.\\./lynis") lynis-dir))
5341 (invoke "sh" "lynis-devkit" "run" "unit-tests"))))))))
5342 (home-page "https://cisofy.com/lynis/")
5343 (synopsis "Security auditing tool")
5344 (description "Lynis is a security auditing tool. It performs an in-depth
5345security scan and runs on the system itself. The primary goal is to test
5346security defenses and provide tips for further system hardening. It will also
5347scan for general system information, vulnerable software packages, and
5348possible configuration issues.")
5349 (license license:gpl3+)))
5350
5351(define-public ngrep
5352 (package
5353 (name "ngrep")
5354 (version "1.47")
5355 (source
5356 (origin
5357 (method git-fetch)
5358 (uri (git-reference
5359 (url "https://github.com/jpr5/ngrep/")
5360 (commit (string-append "V" (string-replace-substring version "." "_")))))
5361 (file-name (git-file-name name version))
5362 (sha256
5363 (base32
5364 "1x2fyd7wdqlj1r76ilal06cl2wmbz0ws6i3ys204sbjh1cj6dcl7"))))
5365 (build-system gnu-build-system)
5366 (inputs
5367 (list libpcap))
5368 (arguments
5369 `(#:tests? #f ;; No tests.
5370 #:configure-flags (list (string-append "--with-pcap-includes="
5371 (assoc-ref %build-inputs "libpcap")
5372 "/include/pcap"))))
5373 (home-page "https://github.com/jpr5/ngrep/")
5374 (synopsis "Grep-like utility to search for network packets on an interface")
5375 (description "@command{ngrep} is like GNU grep applied to the network
5376layer. It's a PCAP-based tool that allows you to specify an extended regular
5377or hexadecimal expression to match against data payloads of packets. It
5378understands many kinds of protocols, including IPv4/6, TCP, UDP, ICMPv4/6,
5379IGMP and Raw, across a wide variety of interface types, and understands BPF
5380filter logic in the same fashion as more common packet sniffing tools, such as
5381tcpdump and snoop.")
5382 (license license:bsd-3)))
5383
5384(define-public pam-mount
5385 (package
5386 (name "pam-mount")
5387 (version "2.20")
5388 (source
5389 (origin
5390 (method url-fetch)
5391 (uri (string-append "https://inai.de/files/pam_mount/pam_mount-"
5392 version ".tar.xz"))
5393 (sha256
5394 (base32 "1vbc6fd826qgj5qq5g06hc64x6n372xhb92bfvhzi02n91x209jl"))))
5395 (build-system gnu-build-system)
5396 (arguments
5397 (list
5398 #:configure-flags
5399 #~(list (string-append "--with-slibdir=" #$output "/lib")
5400 (string-append "--with-ssbindir=" #$output "/sbin")
5401 "--with-cryptsetup")
5402 #:phases
5403 #~(modify-phases %standard-phases
5404 (add-after 'unpack 'patch-file-names
5405 (lambda* (#:key inputs outputs #:allow-other-keys)
5406 (let ((out (assoc-ref outputs "out")))
5407 (substitute* "src/mtcrypt.c"
5408 (("\"(mount|umount)\";" _ command)
5409 (format #f "\"~a\";"
5410 (search-input-file inputs
5411 (string-append "bin/" command))))
5412 (("\"(fsck)\"," _ command)
5413 (format #f "\"~a\","
5414 (search-input-file inputs
5415 (string-append "sbin/" command)))))
5416 (substitute* "src/rdconf1.c"
5417 (("\"(mount|umount)\", \"" _ command)
5418 (format #f "\"~a\", \""
5419 (search-input-file inputs
5420 (string-append "bin/" command))))
5421 (("\"(fsck)\", \"" _ command)
5422 (format #f "\"~a\", \""
5423 (search-input-file inputs
5424 (string-append "sbin/" command))))
5425 (("\"pmvarrun\", \"")
5426 (format #f "\"~a/sbin/pmvarrun\", \"" out)))))))))
5427 (native-inputs
5428 (list perl pkg-config))
5429 (inputs
5430 (append
5431 (cons cryptsetup-minimal (libcryptsetup-propagated-inputs))
5432 (list libhx
5433 libxml2
5434 linux-pam
5435 openssl
5436 pcre2
5437 util-linux
5438 eudev)))
5439 (home-page "https://inai.de/projects/pam_mount/")
5440 (synopsis "PAM module to mount volumes for a user session")
5441 (description
5442 "Pam-mount is a PAM module to mount volumes when a user logs in.
5443It can mount all local file systems supported by @command{mount}, as well as
5444LUKS volumes encrypted with the user's log-in password.")
5445 (license (list license:gpl2+ license:lgpl2.1+))))
5446
5447(define-public pam-uaccess
5448 (let ((commit "54fbf043c63cc500b4850b0b4a12ea14078f2b53")
5449 (revision "0"))
5450 (package
5451 (name "pam-uaccess")
5452 (version (git-version "0.0.0" revision commit))
5453 (source (origin
5454 (method git-fetch)
5455 (uri (git-reference
5456 (url "https://git.sr.ht/~kennylevinsen/pam_uaccess")
5457 (commit commit)))
5458 (file-name (git-file-name name version))
5459 (sha256
5460 (base32
5461 "08068cw4nvcanym8b5dyccnnb3qc3f09pbvi6fcfiz227yx73npc"))))
5462 (build-system meson-build-system)
5463 (native-inputs (list pkg-config))
5464 (inputs (list acl eudev linux-pam))
5465 (home-page "https://git.sr.ht/~kennylevinsen/pam_uaccess")
5466 (synopsis
5467 "PAM module that grants access to devices tagged @code{uaccess} in udev")
5468 (description
5469 "@code{pam_uaccess} is a PAM module that grants access to devices tagged
5470@code{uaccess} in udev for the duration of the users' session, replacing
5471elogind's uaccess feature.")
5472 (license license:expat))))
5473
5474(define-public jc
5475 (package
5476 (name "jc")
5477 (version "1.25.7")
5478 (source
5479 (origin
5480 ;; The PyPI tarball lacks the test suite.
5481 (method git-fetch)
5482 (uri (git-reference
5483 (url "https://github.com/kellyjonbrazil/jc")
5484 (commit (string-append "v" version))))
5485 (file-name (git-file-name name version))
5486 (sha256
5487 (base32 "05fcif1midcqvj93msn1mpllqdni3fr0iz1ab56w589rwr3w1rva"))))
5488 (build-system pyproject-build-system)
5489 (arguments
5490 (list
5491 #:phases
5492 #~(modify-phases %standard-phases
5493 ;; XXX Guix's America/Los_Angeles time zone is somehow broken.
5494 (add-before 'check 'hack-time-zone
5495 (lambda _
5496 (setenv "TZ" "PST8PDT")
5497 (substitute* (find-files "tests" "^test.*\\.py$")
5498 (("America/Los_Angeles") "PST8PDT"))))
5499 (add-before 'wrap 'install-completions
5500 (lambda _
5501 (define (install-completion option file)
5502 (let ((jc (string-append #$output "/bin/jc"))
5503 (file (string-append #$output file)))
5504 (mkdir-p (dirname file))
5505 (with-output-to-file file
5506 (lambda _ (invoke jc option)))))
5507 (install-completion "-B" "/share/bash-completion/completions/jc")
5508 (install-completion "-Z" "/share/zsh/site-functions/_jc"))))))
5509 (native-inputs
5510 (list python-pytest
5511 python-setuptools))
5512 (propagated-inputs
5513 (list python-pygments
5514 python-ruamel.yaml
5515 python-xmltodict))
5516 (home-page "https://github.com/kellyjonbrazil/jc")
5517 (synopsis "Convert the output of command-line tools to JSON")
5518 (description "@code{jc} JSONifies the output of many CLI tools and
5519file-types for easier parsing in scripts.")
5520 (license license:expat)))
5521
5522(define-public jtbl
5523 (package
5524 (name "jtbl")
5525 (version "1.6.0")
5526 (source
5527 (origin
5528 (method git-fetch)
5529 (uri (git-reference
5530 (url "https://github.com/kellyjonbrazil/jtbl")
5531 (commit (string-append "v" version))))
5532 (file-name (git-file-name name version))
5533 (sha256
5534 (base32 "1gryjfjchvfb2nv797h5ba2qz54ig5kkjwcq8ycfdffdk1931d10"))))
5535 (build-system pyproject-build-system)
5536 (native-inputs
5537 (list python-pytest
5538 python-setuptools
5539 python-wheel))
5540 (inputs
5541 (list python-tabulate))
5542 (home-page "https://github.com/kellyjonbrazil/jtbl")
5543 (synopsis "Command-line tool to print JSON data as a table in the terminal")
5544 (description
5545 "@code{jtbl} accepts piped JSON data from stdin and outputs a text table
5546representation to stdout.")
5547 (license license:expat)))
5548
5549(define-public hosts
5550 (package
5551 (name "hosts")
5552 (version "3.6.5")
5553 (source
5554 (origin
5555 (method git-fetch)
5556 (uri (git-reference
5557 (url "https://github.com/xwmx/hosts")
5558 (commit version)))
5559 (file-name (git-file-name name version))
5560 (sha256
5561 (base32 "1kzd4lxlflam87dhbx1jx7bj6v6sa4f2024mfxj2768kp9qapraj"))))
5562 (build-system copy-build-system)
5563 (native-inputs
5564 (list bats)) ;for tests
5565 (inputs
5566 (list gawk
5567 bash-minimal
5568 coreutils
5569 diffutils
5570 grep
5571 ncurses ;for tput
5572 sed))
5573 (arguments
5574 (list
5575 #:install-plan
5576 #~'(("hosts" "bin/hosts")
5577 ("etc/hosts-completion.bash" "/etc/bash_completion.d/hosts")
5578 ("etc/hosts-completion.zsh" "/share/zsh/site-functions/_hosts")
5579 ("README.md"
5580 #$(string-append "/share/doc/" name "-" version "/README.md")))
5581 #:phases
5582 #~(modify-phases %standard-phases
5583 (add-after 'unpack 'patch-hosts
5584 (lambda* (#:key inputs #:allow-other-keys)
5585 (substitute* "test/test_helper.bash"
5586 (("export _HOSTS=.*")
5587 (string-append "export _HOSTS=" #$output "/bin/hosts")))
5588 (substitute* (cons* "hosts"
5589 ;; *.bash and *.bats.
5590 (find-files "test" "\\.bat?sh?.*$"))
5591 (("\\btput\\b") (search-input-file inputs "bin/tput"))
5592 (("\\bsed\\b") (search-input-file inputs "bin/sed"))
5593 (("\\bawk\\b") (search-input-file inputs "bin/awk"))
5594 (("\\bgrep\\b") (search-input-file inputs "bin/grep"))
5595 (("\\bdiff\\b") (search-input-file inputs "bin/diff"))
5596 (("\\bcp\\b") (search-input-file inputs "bin/cp"))
5597 (("\\bchmod\\b") (search-input-file inputs "bin/chmod")))))
5598 (add-after 'install 'check
5599 (lambda* (#:key tests? inputs #:allow-other-keys)
5600 (if tests?
5601 (begin
5602 (delete-file "hosts") ;Ensure installed hosts is checked.
5603 (setenv "PATH" "") ;Ensure substitutions were correct.
5604 (setenv "TERM" "linux") ;Set to tty for test.
5605 (invoke (search-input-file inputs "/bin/bats")
5606 "test"))))))))
5607 (home-page "https://github.com/xwmx/hosts/")
5608 (synopsis "Script for editing a foreign distro's @file{/etc/hosts} file")
5609 (description "Hosts is a command line program for managing
5610@file{/etc/hosts} entries. On Guix System, @file{/etc/hosts} is managed from
5611the system configuration; hosts only works when using the Guix package manager
5612on a foreign distro. @command{hosts} works with existing hosts files and
5613entries, providing commands to add, remove, comment, and search.")
5614 (license license:expat)))
5615
5616(define-public nmrpflash
5617 (package
5618 (name "nmrpflash")
5619 (version "0.9.27")
5620 (source
5621 (origin
5622 (method git-fetch)
5623 (uri
5624 (git-reference
5625 (url "https://github.com/jclehner/nmrpflash")
5626 (commit (string-append "v" version))))
5627 (sha256
5628 (base32 "1fi64cqdllxsradh1iczyxsqgn2kcncdfaf94xll30ghpyz06jb2"))
5629 (file-name (git-file-name name version))))
5630 (build-system gnu-build-system)
5631 (arguments
5632 (list
5633 #:tests? #f ; none exist
5634 #:make-flags
5635 #~(list (string-append "CC=" #$(cc-for-target))
5636 (string-append "PREFIX=" #$output))
5637 #:phases
5638 #~(modify-phases %standard-phases
5639 (delete 'configure)
5640 (add-before 'install 'prepare-install
5641 (lambda _
5642 (mkdir-p (string-append #$output "/bin")))))))
5643 (native-inputs
5644 (list pkg-config))
5645 (inputs
5646 (list libnl libpcap))
5647 (home-page "https://github.com/jclehner/nmrpflash")
5648 (synopsis "Reflash (``unbrick'') Netgear devices with corrupted firmware")
5649 (description "This package provides a utility to flash a new firmware
5650image to a Netgear device. It has been tested on Netgear EX2700, EX6120,
5651EX6150v2, DNG3700v2, R6100, R6220, R7000, D7000, WNR3500, R6400, R6800,
5652R8000, R8500, WNDR3800, but is likely to be compatible with many other
5653Netgear devices.")
5654 (license license:gpl3+)))
5655
5656(define-public atop
5657 (package
5658 (name "atop")
5659 (version "2.13.0")
5660 (source (origin
5661 (method url-fetch)
5662 (uri (string-append "https://www.atoptool.nl/download/atop-"
5663 version ".tar.gz"))
5664 (sha256
5665 (base32
5666 "0x58wrkaz9hp6cwr4bsg19029x3zz7gifkxgwliajb7mr622y67a"))))
5667 (build-system gnu-build-system)
5668 (arguments
5669 (list
5670 #:tests? #f ; no test suite
5671 #:make-flags
5672 #~(list (string-append "CC=" #$(cc-for-target))
5673 (string-append "DESTDIR=" #$output)
5674 (string-append "SYSDPATH=/etc/systemd/system")
5675 (string-append "PMPATHD=/etc/systemd/system-sleep")
5676 ;; Or else it tries to create /var/log/atop...
5677 (string-append "LOGPATH="))
5678 #:phases
5679 #~(modify-phases %standard-phases
5680 (delete 'configure) ; No ./configure script
5681 (add-before 'build 'patch-build
5682 (lambda _
5683 (substitute* "Makefile"
5684 ;; Don't use /usr as a prefix.
5685 (("/usr") "")
5686 ;; Otherwise, it creates a blank configuration file as a "default".
5687 (("touch.*DEFPATH)/atop") "")
5688 (("chmod.*DEFPATH)/atop") "")))))))
5689 (native-inputs (list pkg-config))
5690 (inputs
5691 (list glib
5692 ncurses
5693 python-wrapper ; for `atopgpud`
5694 zlib))
5695 (home-page "https://www.atoptool.nl/")
5696 (synopsis "Linux performance monitoring console")
5697 (description "Atop is an ASCII full-screen performance monitor for Linux
5698that is capable of reporting the activity of all processes (even processes have
5699finished during the monitoring interval), daily logging of system and process
5700activity for long-term analysis, highlighting overloaded system resources by
5701using colors, etc. At regular intervals, it shows system-level activity related
5702to the CPU, memory, swap, disks (including LVM) and network layers, and for
5703every process (and thread) it shows e.g. the CPU utilization, memory growth,
5704disk utilization, priority, username, state, and exit code.")
5705 (properties
5706 `((release-monitoring-url . "https://www.atoptool.nl/downloadatop.php")))
5707 (license license:gpl2+)))
5708
5709(define-public fiano
5710 (package
5711 (name "fiano")
5712 ;; The versioning count has been changed since commit <2021-12-01>
5713 ;; 1eb599564549691603589219c2be34f966a32ff1.
5714 (version "1.2.0")
5715 (source
5716 (origin
5717 (method git-fetch)
5718 (uri (git-reference
5719 (url "https://github.com/linuxboot/fiano")
5720 (commit (string-append "v" version))))
5721 (file-name (git-file-name name version))
5722 (sha256
5723 (base32 "0s5fx4lhgb68qbx4ql34rcm678qdf0c4xl97bgc8dx9xwwqifza1"))))
5724 (build-system go-build-system)
5725 (arguments
5726 (list
5727 #:install-source? #f
5728 #:import-path "github.com/linuxboot/fiano/cmds/..."
5729 #:unpack-path "github.com/linuxboot/fiano"))
5730 (inputs
5731 (list go-github-com-dustin-go-humanize
5732 go-github-com-fatih-camelcase
5733 go-github-com-hashicorp-go-multierror
5734 go-github-com-jedib0t-go-pretty-v6
5735 go-github-com-jessevdk-go-flags
5736 go-github-com-klauspost-compress
5737 go-github-com-pierrec-lz4
5738 go-github-com-spf13-pflag
5739 go-github-com-stretchr-testify
5740 go-github-com-tjfoc-gmsm
5741 go-github-com-u-root-u-root
5742 go-github-com-ulikunitz-xz
5743 go-github-com-xaionaro-go-bytesextra
5744 go-github-com-xaionaro-go-gosrc
5745 go-golang-org-x-text))
5746 (home-page "https://github.com/linuxboot/fiano")
5747 (synopsis "UEFI image editor")
5748 (description
5749 "This package provides a command-line UEFI image editor, including cbfs,
5750create-ffs, fmap, fspinfo, glzma, guid2english, microcode and utk CLI
5751utilities.")
5752 (license license:bsd-3)))
5753
5754(define-public novena-eeprom
5755 (package
5756 (name "novena-eeprom")
5757 (version "2.3")
5758 (source (origin
5759 (method git-fetch)
5760 (uri (git-reference
5761 (url "https://github.com/xobs/novena-eeprom.git")
5762 (commit (string-append "v" version))))
5763 (file-name (string-append name "-" version "-checkout"))
5764 (sha256
5765 (base32
5766 "00pd71mg0g20v0820ggp3ghf9nyj5s4wavaz9mkmrmsr91hcnf7i"))))
5767 (build-system gnu-build-system)
5768 (arguments
5769 `(#:tests? #f ; No tests exist
5770 #:make-flags
5771 (list (string-append "CC=" ,(cc-for-target)))
5772 #:phases
5773 (modify-phases %standard-phases
5774 (delete 'configure)
5775 (replace 'install
5776 (lambda* (#:key outputs #:allow-other-keys)
5777 (let* ((out (assoc-ref outputs "out"))
5778 (out-bin (string-append out "/bin"))
5779 (out-share-man (string-append out "/share/man/man8")))
5780 (install-file "novena-eeprom" out-bin)
5781 (install-file "novena-eeprom.8" out-share-man)))))))
5782 (inputs
5783 (list i2c-tools-3))
5784 (synopsis "Novena EEPROM editor")
5785 (description "This package provides an editor for the Novena EEPROM.
5786Novena boards contain a device-dependent descriptive EEPROM that defines
5787various parameters such as serial number, MAC address, and featureset.
5788This program allows you to view and manipulate this EEPROM list.")
5789 (home-page "https://github.com/xobs/novena-eeprom/")
5790 (supported-systems '("armhf-linux"))
5791 (license license:bsd-3)))
5792
5793(define-public lrzsz
5794 (package
5795 (name "lrzsz")
5796 (version "0.12.20")
5797 (source (origin
5798 (method url-fetch)
5799 (uri (string-append "https://www.ohse.de/uwe/releases/lrzsz-"
5800 version ".tar.gz"))
5801 (sha256
5802 (base32
5803 "1wcgfa9fsigf1gri74gq0pa7pyajk12m4z69x7ci9c6x9fqkd2y2"))))
5804 (build-system gnu-build-system)
5805 (arguments
5806 `(#:phases
5807 (modify-phases %standard-phases
5808 (replace 'configure
5809 (lambda* (#:key outputs #:allow-other-keys)
5810 (setenv "CONFIG_SHELL" (which "bash"))
5811 (setenv "CFLAGS"
5812 (string-append "-g -O2 "
5813 "-Wno-error=implicit-int "
5814 "-Wno-error=implicit-function-declaration "
5815 "-Wno-error=incompatible-pointer-types"))
5816 (invoke "./configure"
5817 (string-append "--prefix="
5818 (assoc-ref outputs "out"))))))))
5819 (synopsis "Implementation of XMODEM/YMODEM/ZMODEM transfer protocols")
5820 (description "This package provides programs that transfer files using
5821the XMODEM/YMODEM/ZMODEM file transfer protocols.")
5822 (home-page "https://ohse.de/uwe/software/lrzsz.html")
5823 (license license:gpl2+)))
5824
5825(define-public nq
5826 (package
5827 (name "nq")
5828 (version "1.0")
5829 (source
5830 (origin
5831 (method git-fetch)
5832 (uri (git-reference
5833 (url "https://github.com/leahneukirchen/nq")
5834 (commit (string-append "v" version))))
5835 (file-name (git-file-name name version))
5836 (sha256
5837 (base32 "0pl84vrjg7l0gyjar7v0qn4v63n30b93nbldxawbmqls9m443mc1"))))
5838 (build-system gnu-build-system)
5839 (native-inputs
5840 (list perl))
5841 (arguments
5842 (list #:make-flags
5843 #~(list (string-append "CC=" #$(cc-for-target))
5844 (string-append "PREFIX=" #$output))
5845 #:phases
5846 #~(modify-phases %standard-phases
5847 (delete 'configure))))
5848 (synopsis "Unix command line queue utility")
5849 (description
5850 "@code{nq} can create very lightweight job queue systems which require no
5851setup, maintenance, supervision, or any long-running processes.")
5852 (home-page "https://github.com/leahneukirchen/nq")
5853 (license license:public-domain)))
5854
5855(define-public lsofgraph
5856 (let ((commit "1d414bdc727c00a8c6cbfffc3c43128c60d6f0de")
5857 (revision "1"))
5858 (package
5859 (name "lsofgraph")
5860 (version (git-version "0.0.1" revision commit)) ;no upstream release
5861 (source (origin
5862 (method git-fetch)
5863 (uri (git-reference
5864 (url "https://github.com/zevv/lsofgraph")
5865 (commit commit)))
5866 (file-name (git-file-name name version))
5867 (sha256
5868 (base32
5869 "058x04yp6bc77hbl3qchqm7pa8f9vqfl9jryr88m8pzl7kvpif54"))))
5870 (build-system trivial-build-system)
5871 (inputs
5872 (list lua))
5873 (arguments
5874 `(#:modules ((guix build utils))
5875 #:builder
5876 (begin
5877 (use-modules (guix build utils))
5878 ;; copy source
5879 (copy-recursively (assoc-ref %build-inputs "source") ".")
5880 ;; patch-shebang phase
5881 (setenv "PATH"
5882 (string-append (assoc-ref %build-inputs "lua") "/bin"
5883 ":" (getenv "PATH")))
5884 (substitute* "lsofgraph"
5885 (("#!/usr/bin/env lua")
5886 (string-append "#!" (which "lua"))))
5887 ;; install phase
5888 (install-file "lsofgraph" (string-append %output "/bin"))
5889 (let ((doc (string-append
5890 %output "/share/doc/" ,name "-" ,version)))
5891 (mkdir-p doc)
5892 (install-file "LICENSE" doc)
5893 (install-file "README.md" doc))
5894 #t)))
5895 (home-page "https://github.com/zevv/lsofgraph")
5896 (synopsis "Convert @code{lsof} output to @code{graphviz}")
5897 (description "Utility to convert @code{lsof} output to a graph showing
5898FIFO and UNIX interprocess communication.")
5899 (license license:bsd-2))))
5900
5901(define-public runitor
5902 (package
5903 (name "runitor")
5904 (version "1.3.0-build.4")
5905 (source
5906 (origin
5907 (method git-fetch)
5908 (uri (git-reference
5909 (url "https://github.com/bdd/runitor")
5910 (commit (string-append "v" version))))
5911 (file-name (git-file-name name version))
5912 (sha256
5913 (base32 "00l83jcjmf5kcq8yzq575kk6ljkkr2xhm5cx27zzb1yhxn93xj7n"))))
5914 (build-system go-build-system)
5915 (arguments
5916 `(#:unpack-path "bdd.fi/x/runitor"
5917 #:build-flags '(,(string-append "-ldflags=-X main.Version=" version))
5918 #:import-path "bdd.fi/x/runitor/cmd/runitor"
5919 #:install-source? #f))
5920 (home-page "https://github.com/bdd/runitor")
5921 (synopsis "Command runner with healthchecks.io integration")
5922 (description
5923 "Runitor runs the supplied command, captures its output, and based on its
5924exit code reports successful or failed execution to
5925@url{https://healthchecks.io,https://healthchecks.io} or your private instance.")
5926 (license license:bsd-0)))
5927
5928(define-public udpcast
5929 (package
5930 (name "udpcast")
5931 (version "20250223")
5932 (source
5933 (origin
5934 (method url-fetch)
5935 ;; XXX: Original server is at https://www.udpcast.linux.lu is not
5936 ;; reliable.
5937 (uri (list (string-append
5938 "https://fossies.org/linux/privat/udpcast-"
5939 version ".tar.gz")
5940 (string-append
5941 "https://www.udpcast.linux.lu/download/udpcast-"
5942 version ".tar.gz")))
5943 (sha256
5944 (base32 "19qa6yp0svhvyra4898c6kjs56bn7yr9cavxk1vbrqbpr1a7bzff"))))
5945 (build-system gnu-build-system)
5946 (native-inputs
5947 (list autoconf automake m4 perl))
5948 (arguments
5949 (list #:tests? #f ;no test suite
5950 #:make-flags #~(list (string-append "sbindir=" #$output "/sbin/"))))
5951 (synopsis "Multicast file transfer tool")
5952 (description
5953 "UDPcast is a file transfer tool that can send data simultaneously to
5954many destinations on a LAN. This can for instance be used to install entire
5955classrooms of PC's at once. The advantage of UDPcast over using other
5956methods (nfs, ftp, whatever) is that UDPcast uses UDP's multicast abilities:
5957it won't take longer to install 15 machines than it would to install just 2.")
5958 (home-page "https://www.udpcast.linux.lu")
5959 (license license:gpl2+)))
5960
5961(define-public greetd
5962 (package
5963 (name "greetd")
5964 (version "0.10.3")
5965 (home-page "https://git.sr.ht/~kennylevinsen/greetd")
5966 (source (origin
5967 (method git-fetch)
5968 (uri (git-reference
5969 (url home-page)
5970 (commit version)))
5971 (file-name (git-file-name name version))
5972 (sha256
5973 (base32 "1j3c7skby9scsq6p1f6nacbiy9b26y1sswchdsp8p3vv7fgdh2wf"))))
5974 (build-system cargo-build-system)
5975 (arguments
5976 `(#:install-source? #f
5977 #:phases
5978 (modify-phases %standard-phases
5979 (add-after 'unpack 'patch-/bin/sh
5980 (lambda* (#:key inputs #:allow-other-keys)
5981 (substitute* "greetd/src/session/worker.rs"
5982 (("/bin/sh") (search-input-file inputs "/bin/sh")))))
5983 (add-after 'build 'build-man-pages
5984 (lambda* (#:key inputs #:allow-other-keys)
5985 (define (scdoc-cmd doc lvl)
5986 (system (string-append "scdoc < "
5987 doc "-" lvl ".scd > "
5988 doc "." lvl)))
5989 (with-directory-excursion "man"
5990 (scdoc-cmd "greetd" "1")
5991 (scdoc-cmd "greetd" "5")
5992 (scdoc-cmd "greetd-ipc" "7")
5993 (scdoc-cmd "agreety" "1"))))
5994 (replace 'install
5995 (lambda* (#:key inputs outputs #:allow-other-keys)
5996 (let* ((out (assoc-ref outputs "out"))
5997 (bin (string-append out "/bin"))
5998 (sbin (string-append out "/sbin"))
5999 (share (string-append out "/share"))
6000 (man (string-append share "/man"))
6001 (man1 (string-append man "/man1"))
6002 (man5 (string-append man "/man5"))
6003 (man7 (string-append man "/man7"))
6004 (release ,(if (%current-target-system)
6005 (string-append
6006 "target/"
6007 (platform-rust-target
6008 (lookup-platform-by-target
6009 (%current-target-system)))
6010 "/release")
6011 "target/release"))
6012 (greetd-bin (string-append release "/greetd"))
6013 (agreety-bin (string-append release "/agreety")))
6014 (install-file greetd-bin sbin)
6015 (install-file agreety-bin bin)
6016 (with-directory-excursion "man"
6017 (install-file "greetd.1" man1)
6018 (install-file "greetd.5" man5)
6019 (install-file "greetd-ipc.7" man7)
6020 (install-file "agreety.1" man1))))))))
6021 (inputs
6022 ;; Full bash, not bash-minimal. See https://issues.guix.gnu.org/76105.
6023 (cons* bash linux-pam (cargo-inputs 'greetd)))
6024 (native-inputs
6025 (list scdoc))
6026 (synopsis "Minimal and flexible login manager daemon")
6027 (description
6028 "greetd is a minimal and flexible login manager daemon
6029that makes no assumptions about what you want to launch.
6030
6031If you can run it from your shell in a TTY, greetd can start it.
6032
6033If it can be taught to speak a simple JSON-based IPC protocol,
6034then it can be a greeter.")
6035 (license license:gpl3+)))
6036
6037(define-public greetd-pam-mount
6038 (package
6039 (inherit pam-mount)
6040 (name "greetd-pam-mount")
6041 (arguments
6042 (substitute-keyword-arguments arguments
6043 ((#:configure-flags flags ''())
6044 #~(cons* "--with-rundir=/run/greetd" #$flags))
6045 ((#:phases phases)
6046 #~(modify-phases #$phases
6047 (add-after 'unpack 'patch-config-file-name
6048 (lambda* (#:key inputs #:allow-other-keys)
6049 (substitute* "src/pam_mount.c"
6050 ((".*define CONFIGFILE .*$")
6051 "#define CONFIGFILE \"/etc/security/greetd_pam_mount.conf.xml\"\n")
6052 (("pam_mount_config") "greetd_pam_mount_config")
6053 (("pam_mount_system_authtok") "greetd_pam_mount_system_authtok"))))))))
6054 (synopsis "PAM module to mount volumes for a user session (greetd variant)")
6055 (description
6056 "Pam-mount is a PAM module to mount volumes when a user logs in.
6057It can mount all local file systems supported by @command{mount}, as well as
6058LUKS volumes encrypted with the user's log-in password.
6059
6060This package inherits pam-mount but is compiled specifically for use with
6061the @command{greetd} log-in manager. It uses a different configuration
6062location and PAM name space from the original.
6063
6064This allows greetd-pam-mount to auto-(un)mount @env{XDG_RUNTIME_DIR} without
6065interfering with any pam-mount configuration.")))
6066
6067(define-public wlgreet
6068 (package
6069 (name "wlgreet")
6070 (version "0.5.0")
6071 (source (origin
6072 (method git-fetch)
6073 (uri (git-reference
6074 (url "https://git.sr.ht/~kennylevinsen/wlgreet")
6075 (commit version)))
6076 (file-name (git-file-name name version))
6077 (sha256
6078 (base32
6079 "0d7lfx5jg2w7fp7llwrirnbsp27nv74f21mhrspd9ilk2cacf12d"))))
6080 (build-system cargo-build-system)
6081 (arguments
6082 (list #:phases
6083 #~(modify-phases %standard-phases
6084 (add-after 'unpack 'remove-bundled-fonts
6085 (lambda _
6086 (delete-file-recursively "fonts")))
6087 (add-after 'remove-bundled-fonts 'fix-font-references
6088 (lambda* (#:key inputs #:allow-other-keys)
6089 (substitute* "src/draw.rs"
6090 (("\\.\\./fonts/dejavu/DejaVuSansMono\\.ttf")
6091 (search-input-file
6092 inputs
6093 "share/fonts/truetype/DejaVuSansMono.ttf"))
6094 (("\\.\\./fonts/Roboto-Regular\\.ttf")
6095 (search-input-file
6096 inputs
6097 "share/fonts/truetype/Roboto-Regular.ttf")))))
6098 (add-after 'configure 'fix-library-references
6099 (lambda* (#:key inputs vendor-dir #:allow-other-keys)
6100 (substitute* (find-files vendor-dir "\\.rs$")
6101 (("lib(wayland-.*|xkbcommon)\\.so" so-file)
6102 (search-input-file
6103 inputs
6104 (string-append "lib/" so-file)))))))))
6105 (inputs
6106 (cons* font-dejavu
6107 font-google-roboto
6108 libxkbcommon
6109 wayland
6110 (cargo-inputs 'wlgreet)))
6111 (home-page "https://git.sr.ht/~kennylevinsen/wlgreet")
6112 (synopsis "Bare-bones Wayland-based greeter for @command{greetd}")
6113 (description
6114 "@command{wlgreet} provides a @command{greetd} greeter
6115that runs on a Wayland compositor such as @command{sway}. It
6116is implemented with pure Wayland APIs, so it does not depend
6117on a GUI toolkit.")
6118 (license license:gpl3)))
6119
6120(define-public gtkgreet
6121 (package
6122 (name "gtkgreet")
6123 (version "0.8")
6124 (source
6125 (origin
6126 (method git-fetch)
6127 (uri (git-reference
6128 (url "https://git.sr.ht/~kennylevinsen/gtkgreet")
6129 (commit version)))
6130 (file-name (git-file-name name version))
6131 (sha256
6132 (base32 "0bqxz39lc8vh6bkirvrbn2lgf1qz5b04lfwgp5xa1ki1bnm5i80q"))))
6133 (build-system meson-build-system)
6134 (native-inputs (list pkg-config scdoc))
6135 (inputs (list gtk+ gtk-layer-shell json-c))
6136 (synopsis "GTK-based greeter for greetd")
6137 (description
6138 "GTK-based greeter for greetd, to be run under a compositor such as Cage.")
6139 (home-page "https://git.sr.ht/~kennylevinsen/gtkgreet")
6140 (license license:gpl3+)))
6141
6142(define-public tuigreet
6143 (package
6144 (name "tuigreet")
6145 (version "0.9.1")
6146 (source (origin
6147 (method git-fetch)
6148 (uri (git-reference
6149 (url "https://github.com/apognu/tuigreet")
6150 (commit version)))
6151 (file-name (git-file-name name version))
6152 (sha256
6153 (base32
6154 "15h2b97clllbhlw5jc4lwkmir18njnyk56zghafsas84m6jjsikv"))))
6155 (build-system cargo-build-system)
6156 (arguments (list #:install-source? #f))
6157 (inputs (cargo-inputs 'tuigreet))
6158 (home-page "https://github.com/apognu/tuigreet")
6159 (synopsis "Graphical console greeter for @code{greetd}")
6160 (description
6161 "This package provides a graphical console greeter for @code{greetd}. It
6162doesn't need a Wayland compositor to be used.")
6163 (license license:gpl3+)))
6164
6165(define-public libseat
6166 (package
6167 (name "libseat")
6168 (version "0.9.3")
6169 (source (origin
6170 (method git-fetch)
6171 (uri (git-reference
6172 (url "https://git.sr.ht/~kennylevinsen/seatd")
6173 (commit version)))
6174 (file-name (git-file-name name version))
6175 (sha256
6176 (base32
6177 "1w2g3fykrjkq7q23bmspwq9qyr0js42ypf1h6w3765nya24gywkb"))))
6178 (build-system meson-build-system)
6179 (arguments
6180 (list #:configure-flags #~(list "-Dlibseat-logind=elogind"
6181 "-Dserver=disabled")))
6182 (native-inputs
6183 (list pkg-config))
6184 (propagated-inputs
6185 (list elogind))
6186 (home-page "https://sr.ht/~kennylevinsen/seatd")
6187 (synopsis "Seat management library")
6188 (description
6189 "This package provides a universal seat management library that
6190allows applications to use whatever seat management is available.")
6191 (license license:expat)))
6192
6193(define-public seatd
6194 (package
6195 (inherit libseat)
6196 (name "seatd")
6197 (arguments
6198 (list #:configure-flags #~(list "-Dlibseat-logind=elogind")
6199 #:phases
6200 #~(modify-phases %standard-phases
6201 (add-after 'install 'remove-libs
6202 (lambda* (#:key outputs #:allow-other-keys)
6203 (with-directory-excursion (assoc-ref outputs "out")
6204 (for-each delete-file-recursively '("lib" "include"))))))))
6205 (native-inputs
6206 (list pkg-config
6207 scdoc))
6208 (inputs '())
6209 (synopsis "Seat management daemon")
6210 (description
6211 "This package provides a minimal seat management daemon whose task is to
6212mediate access to shared devices, such as graphics and input, for applications
6213that require it.")
6214 (license license:expat)))
6215
6216(define-public sysdig
6217 (package
6218 (name "sysdig")
6219 (version "0.40.1")
6220 (source (origin
6221 (method git-fetch)
6222 (uri (git-reference
6223 (url "https://github.com/draios/sysdig")
6224 (commit version)))
6225 (file-name (git-file-name name version))
6226 (sha256
6227 (base32
6228 "1npm630fix7vssd7hiv2sh3jbs43jl748zbrhwpx8gly25zqvy1h"))))
6229 (build-system cmake-build-system)
6230 (arguments
6231 (list #:tests? #f ;no test suite
6232 #:configure-flags
6233 #~(list "-DUSE_BUNDLED_DEPS=OFF"
6234 ;; Already built and part of falcosecurity-libs, but
6235 ;; needed for the 'HAS_MODERN_BPF' define.
6236 "-DBUILD_SYSDIG_MODERN_BPF=ON"
6237 #$(string-append "-DSYSDIG_VERSION=" version))))
6238 (native-inputs (list pkg-config))
6239 (inputs
6240 (list falcosecurity-libs
6241 luajit
6242 ncurses
6243 nlohmann-json
6244 yaml-cpp
6245 zlib))
6246 (home-page "https://github.com/draios/sysdig")
6247 (synopsis "System exploration and troubleshooting tool")
6248 (description "Sysdig is a simple tool for deep system visibility, with
6249native support for containers. It combines features of multiple system
6250administration tools such as the @command{strace}, @command{tcpdump},
6251@command{htop}, @command{iftop} and @command{lsof} into a single interface.
6252The novel architecture of the tool means that the performance impact of the
6253tracing on the system is very light, compared to the likes of
6254@command{strace}. The @command{sysdig} command has an interface similar to
6255@command{strace}, while the @command{csysdig} command is better suited for
6256interactive used, and has a user interface similar to @command{htop}.
6257
6258If you use Guix System, the kernel Linux has @acronym{BPF, Berkeley Packet
6259Filter} support, and you should launch this tool using the @samp{--modern-bpf}
6260argument of the @command{sysdig} or @command{csysdig} commands. The following
6261Bash aliases can be added to your @file{~/.bash_profile} file, for example:
6262
6263alias sysdig=sudo sysdig --modern-bpf
6264alias cysdig=sudo csysdig --modern-bpf
6265") ;XXX no @example Texinfo support
6266 (license license:asl2.0)))
6267
6268(define-public systemd-documentation
6269 (package
6270 (name "systemd-documentation")
6271 (version "261.2")
6272 (source (origin
6273 (method git-fetch)
6274 (uri (git-reference
6275 (url "https://github.com/systemd/systemd")
6276 (commit (string-append "v" version))))
6277 (file-name (git-file-name name version))
6278 (sha256
6279 (base32
6280 "014mjygixfh9j1p1f09xgy114v5lfah6hwh8xcscy1nqxk3p2hf3"))))
6281 (build-system meson-build-system)
6282 (arguments
6283 (list #:configure-flags #~(list "-Dman=true")
6284 #:tests? #f
6285 #:phases
6286 #~(modify-phases %standard-phases
6287 (replace 'build
6288 (lambda* (#:key parallel-build? #:allow-other-keys)
6289 (invoke "ninja" "--verbose"
6290 "-j" (if parallel-build?
6291 (number->string (parallel-job-count))
6292 "1")
6293 "man")))
6294 (replace 'install
6295 (lambda _
6296 (let ((man-dir (string-append #$output "/share/man")))
6297 (with-directory-excursion "man"
6298 (for-each
6299 (lambda (n)
6300 (let ((man-pages (find-files "."
6301 (format #f "\\.~a$" n)))
6302 (dest (format #f "~a/man~a" man-dir n)))
6303 (for-each (lambda (x)
6304 (install-file x dest))
6305 man-pages)))
6306 (iota 8 1)))))))))
6307 (native-inputs (list docbook-xml-4.5 docbook-xsl gperf python-3
6308 python-jinja2 libxslt))
6309 (inputs (list libxcrypt))
6310 (home-page "https://systemd.io/")
6311 (synopsis "Man pages of systemd")
6312 (description "This package provides the entire man pages collection of
6313systemd, the system and service manager.")
6314 (license license:lgpl2.1+)))
6315
6316(define-public fail2ban
6317 (package
6318 (name "fail2ban")
6319 (version "1.1.0")
6320 (source
6321 (origin
6322 (method git-fetch)
6323 (uri (git-reference
6324 (url "https://github.com/fail2ban/fail2ban")
6325 (commit version)))
6326 (file-name (git-file-name name version))
6327 (sha256
6328 (base32 "0lfakna6ad2xwz95sjxzkavipcsxiy7ybavkdkf9zzmspf2ws4yk"))
6329 (modules '((guix build utils)))
6330 (snippet #~(begin
6331 ;; Replacing those by our own paths-guix.conf
6332 (with-directory-excursion "config"
6333 (for-each delete-file
6334 '("paths-arch.conf" "paths-debian.conf"
6335 "paths-fedora.conf" "paths-freebsd.conf"
6336 "paths-opensuse.conf" "paths-osx.conf")))))
6337 (patches (search-patches "fail2ban-fix-sshd-filter.patch"
6338 "fail2ban-paths-guix-conf.patch"))))
6339 (build-system pyproject-build-system)
6340 (arguments
6341 (list
6342 #:phases
6343 #~(modify-phases %standard-phases
6344 (add-after 'unpack 'avoid-external-binary-in-/bin
6345 (lambda _
6346 (delete-file "fail2ban/setup.py")
6347 (substitute* '("bin/fail2ban-testcases" "setup.py")
6348 ((".*updatePyExec.*")
6349 ""))))
6350 (add-after 'unpack 'patch-setup.py
6351 (lambda _
6352 ;; Get rid of absolute file names.
6353 (substitute* "setup.py"
6354 (("/etc/fail2ban")
6355 "etc/fail2ban")
6356 (("/var/lib/fail2ban")
6357 "var/lib/fail2ban")
6358 (("\"/usr/bin/\"")
6359 "\"usr/bin/\"")
6360 (("\"/usr/lib/fail2ban/\"")
6361 "\"usr/lib/fail2ban/\"")
6362 (("'/usr/share/doc/fail2ban'")
6363 "'usr/share/doc/fail2ban'"))))
6364 (add-after 'unpack 'disable-some-tests
6365 (lambda _
6366 (define (make-suite-regex tests)
6367 (string-append "tests.addTest\\(loadTests\\(("
6368 (string-join tests "|")
6369 ")\\)\\)"))
6370 ;; disable tests performing unacceptable side-effects
6371 (substitute* "fail2ban/tests/utils.py"
6372 (((make-suite-regex (list "actiontestcase.CommandActionTest"
6373 "misctestcase.SetupTest"
6374 "filtertestcase.DNSUtilsNetworkTests"
6375 "filtertestcase.IgnoreIPDNS"
6376 "filtertestcase.GetFailures"
6377 "fail2banclienttestcase.Fail2banServerTest"
6378 "servertestcase.ServerConfigReaderTests")))
6379 ""))))
6380 (add-before 'build 'fix-default-config
6381 (lambda _
6382 (substitute* '("config/paths-common.conf"
6383 "fail2ban/tests/utils.py"
6384 "fail2ban/client/configreader.py"
6385 "fail2ban/client/fail2bancmdline.py"
6386 "fail2ban/client/fail2banregex.py")
6387 (("/etc/fail2ban")
6388 (string-append #$output "/etc/fail2ban")))))
6389 (replace 'check
6390 (lambda* (#:key tests? test-flags #:allow-other-keys)
6391 (when tests?
6392 (invoke "./bin/fail2ban-testcases"))))
6393 (add-after 'fix-default-config 'set-action-dependencies
6394 (lambda* (#:key inputs #:allow-other-keys)
6395 ;; deleting things that are not feasible to fix
6396 ;; or won't be used any way
6397 (with-directory-excursion "config/action.d"
6398 (for-each delete-file
6399 '("apf.conf"
6400 "bsd-ipfw.conf"
6401 "dshield.conf"
6402 "ipfilter.conf"
6403 "ipfw.conf"
6404 "firewallcmd-allports.conf"
6405 "firewallcmd-common.conf"
6406 "firewallcmd-ipset.conf"
6407 "firewallcmd-multiport.conf"
6408 "firewallcmd-new.conf"
6409 "firewallcmd-rich-logging.conf"
6410 "firewallcmd-rich-rules.conf"
6411 "osx-afctl.conf"
6412 "osx-ipfw.conf"
6413 "pf.conf"
6414 "nginx-block-map.conf"
6415 "npf.conf"
6416 "shorewall.conf"
6417 "shorewall-ipset-proto6.conf"
6418 "ufw.conf")))
6419 (define (lookup dir file)
6420 (search-input-file inputs (string-append "/" dir "/" file)))
6421
6422 (substitute* (find-files "config/action.d" "\\.conf$")
6423 ;; TODO: deal with geoiplookup ..
6424 (("(awk|curl|dig|jq)" all cmd)
6425 (lookup "bin" cmd))
6426 (("(cat|echo|grep|head|printf|wc) " all cmd)
6427 (string-append (lookup "bin" cmd) " "))
6428 ((" (date|rm|sed|tail|touch|tr) " all cmd)
6429 (string-append " " (lookup "bin" cmd) " "))
6430 (("cut -d")
6431 (string-append (lookup "bin" "cut") " -d"))
6432 (("`date`")
6433 (string-append "`" (lookup "bin" "date") "`"))
6434 (("id -")
6435 (string-append (lookup "bin" "id") " -"))
6436 (("ip (route|-[46] addr)" all rest)
6437 (string-append (lookup "sbin" "ip") rest))
6438 (("ipset ")
6439 (string-append (lookup "sbin" "ipset") " "))
6440 (("(iptables|ip6tables) <" all cmd)
6441 (string-append (lookup "sbin" cmd) " <"))
6442 (("/usr/bin/nsupdate")
6443 (lookup "bin" "nsupdate"))
6444 (("mail -E")
6445 (string-append (lookup "sbin" "sendmail") " -E"))
6446 (("nftables = nft")
6447 (string-append "nftables = " (lookup "sbin" "nft")))
6448 (("perl -e")
6449 (string-append (lookup "bin" "perl") " -e"))
6450 (("/usr/sbin/sendmail")
6451 (lookup "sbin" "sendmail"))
6452 (("test -e")
6453 (string-append (lookup "bin" "test") " -e"))
6454 (("_whois = whois")
6455 (string-append "_whois = " (lookup "bin" "whois"))))
6456
6457 (substitute* "config/jail.conf"
6458 (("before = paths-debian\\.conf")
6459 "before = paths-guix.conf"))))
6460 (add-after 'install 'copy-man-pages
6461 (lambda _
6462 (define (install-man m)
6463 (lambda (f)
6464 (install-file (string-append f "." m)
6465 (string-append #$output "man/man" m))))
6466
6467 (with-directory-excursion "man"
6468 (for-each (install-man "1")
6469 '("fail2ban" "fail2ban-client" "fail2ban-python"
6470 "fail2ban-regex" "fail2ban-server"
6471 "fail2ban-testcases"))
6472 ((install-man "5") "jail.conf")))))))
6473 (native-inputs (list python-aiosmtpd
6474 python-setuptools))
6475 (inputs (list gawk
6476 coreutils-minimal
6477 curl
6478 grep
6479 jq
6480 iproute
6481 ipset
6482 iptables
6483 `(,isc-bind "utils")
6484 nftables
6485 perl
6486 python-pyinotify
6487 sed
6488 sendmail
6489 sqlite
6490 whois))
6491 (home-page "http://www.fail2ban.org")
6492 (synopsis "Daemon to ban hosts that cause multiple authentication errors")
6493 (description
6494 "Fail2Ban scans log files like @file{/var/log/auth.log} and bans IP
6495addresses conducting too many failed login attempts. It does this by updating
6496system firewall rules to reject new connections from those IP addresses, for a
6497configurable amount of time. Fail2Ban comes out-of-the-box ready to read many
6498standard log files, such as those for sshd and Apache, and is easily
6499configured to read any log file of your choosing, for any error you wish.
6500
6501Though Fail2Ban is able to reduce the rate of incorrect authentication
6502attempts, it cannot eliminate the risk presented by weak authentication. Set
6503up services to use only two factor, or public/private authentication
6504mechanisms if you really want to protect services.")
6505 (license license:gpl2+)))
6506
6507(define-public restartd
6508 (let* ((commit "7044125ac55056f2663536f7137170edf92ebd75")
6509 ;; Version is 0.2.4 in the version file in the repo
6510 ;; but not in github tags.
6511 ;; It is released as 0.2.3-1.1 for other distributions.
6512 ;; Probably because of the lack of activity upstream.
6513 (revision "1"))
6514 (package
6515 (name "restartd")
6516 (version (git-version "0.2.3" revision commit))
6517 (source
6518 (origin
6519 (method git-fetch)
6520 (uri (git-reference
6521 (url "https://github.com/ajraymond/restartd")
6522 (commit commit)))
6523 (file-name (git-file-name name version))
6524 (sha256
6525 (base32
6526 "1m1np00b4zvvwx63gzysbi38i5vj1jsjvh2s0p9czl6dzyz582z0"))
6527 (patches (search-patches "restartd-update-robust.patch"))))
6528 (build-system gnu-build-system)
6529 (arguments
6530 (list
6531 #:tests? #f ; no tests
6532 #:make-flags
6533 #~(list (string-append "CC=" #$(cc-for-target)))
6534 #:phases
6535 #~(modify-phases %standard-phases
6536 (delete 'configure)
6537 (replace 'install
6538 (lambda _
6539 (install-file "restartd.conf" (string-append #$output "/etc"))
6540 (install-file "restartd" (string-append #$output "/sbin"))
6541 (install-file "restartd.8"
6542 (string-append #$output "/share/man/man8"))
6543 (mkdir-p (string-append #$output "/share/man/fr/man8"))
6544 (copy-file
6545 "restartd.fr.8"
6546 (string-append #$output "/share/man/fr/man8/restartd.8")))))))
6547 (home-page "https://launchpad.net/debian/+source/restartd")
6548 (synopsis "Daemon for restarting processes")
6549 (description "This package provides a daemon for checking running and
6550not running processes. It reads the @file{/proc} directory every @var{n}
6551seconds and does a POSIX regexp on the process names. The daemon runs a
6552user-provided script when it detects a program in the running processes, or an
6553alternate script if it doesn't detect the program. The daemon can only be
6554called by the root user, but can use @command{sudo -u user} in the process
6555called if needed.")
6556 (license license:gpl2+))))
6557
6558(define-public rex
6559 (package
6560 (name "rex")
6561 (version "4.1")
6562 (source (origin
6563 (method url-fetch)
6564 (uri (string-append
6565 "https://download.gnu.org.ua/pub/releases/rex/rex-"
6566 version ".tar.gz"))
6567 (sha256
6568 (base32
6569 "1arb8z602invwavskq36nhwy42a3v14iyhi06iqlngfai2k93fai"))))
6570 (build-system gnu-build-system)
6571 (arguments
6572 (list
6573 #:tests? #f ; no tests
6574 #:phases
6575 #~(modify-phases %standard-phases
6576 ;; No configure script and Makefile.
6577 (delete 'configure)
6578 (delete 'build)
6579 (add-before 'install 'patch-exec-expect
6580 (lambda _
6581 (substitute* "rex"
6582 (("exec expect") (string-append "exec " (which "expect"))))))
6583 (replace 'install
6584 (lambda _
6585 (invoke "./install"
6586 (string-append "--prefix=" #$output)))))))
6587 (inputs (list expect))
6588 (home-page "https://www.gnu.org.ua/software/rex/")
6589 (synopsis "Remote execution utility")
6590 (description "@command{rex} runs a supplied command or shell script on
6591several hosts in succession or in parallel. It can also be used to copy a
6592file or files to several hosts.")
6593 (license license:gpl3+)))
6594
6595(define-public doctl
6596 (package
6597 (name "doctl")
6598 (version "1.120.0")
6599 (source (origin
6600 (method git-fetch)
6601 (uri (git-reference
6602 (url "https://github.com/digitalocean/doctl")
6603 (commit (string-append "v" version))))
6604 (file-name (git-file-name name version))
6605 (sha256
6606 (base32
6607 "12fgymgiv6894ghar7ljg69hb7mi18pa2a74sp7fyymqvyhiv6z9"))
6608 (snippet
6609 ;; TODO: Unbundle more.
6610 #~(begin (use-modules (guix build utils))
6611 (for-each delete-file-recursively
6612 (list "vendor/golang.org"))))))
6613 (build-system go-build-system)
6614 (arguments
6615 (list #:import-path "github.com/digitalocean/doctl/cmd/doctl"
6616 #:unpack-path "github.com/digitalocean/doctl"
6617 #:build-flags
6618 #~(list (string-append "-ldflags=-X github.com/digitalocean/doctl.Label=release"
6619 " -X github.com/digitalocean/doctl.Major="
6620 (car (string-split #$version #\.))
6621 " -X github.com/digitalocean/doctl.Minor="
6622 (cadr (string-split #$version #\.))
6623 " -X github.com/digitalocean/doctl.Patch="
6624 (caddr (string-split #$version #\.))))
6625 #:install-source? #f
6626 #:phases
6627 #~(modify-phases %standard-phases
6628 (add-after 'install 'install-completions
6629 (lambda _
6630 (define (install-completion shell file)
6631 (let ((file (string-append #$output file)))
6632 (mkdir-p (dirname file))
6633 (with-output-to-file file
6634 (lambda _
6635 (invoke (string-append #$output "/bin/doctl")
6636 "completion" shell)))))
6637 (install-completion "bash" "/etc/bash_completion.d/doctl")
6638 (install-completion "fish"
6639 "/etc/fish/completions/doctl.fish")
6640 (install-completion "zsh"
6641 "/etc/zsh/site-functions/_doctl"))))))
6642 (native-inputs
6643 (list go-golang-org-x-crypto
6644 go-golang-org-x-mod
6645 go-golang-org-x-net
6646 go-golang-org-x-oauth2
6647 go-golang-org-x-sync
6648 go-golang-org-x-sys
6649 go-golang-org-x-term
6650 go-golang-org-x-text
6651 go-golang-org-x-time
6652 go-golang-org-x-tools))
6653 (home-page "https://github.com/digitalocean/doctl")
6654 (synopsis "Command line client for DigitalOcean")
6655 (description
6656 "@code{doctl} provides a unified command line interface to the DigitalOcean API.")
6657 (license license:asl2.0)))
6658
6659(define-public du-dust
6660 (package
6661 (name "du-dust")
6662 (version "1.2.4")
6663 (source
6664 (origin
6665 (method url-fetch)
6666 (uri (crate-uri "du-dust" version))
6667 (file-name (string-append name "-" version ".tar.gz"))
6668 (sha256
6669 (base32 "0lksdw44s4fwyfscn79f8c8s3a5ijwfbxny539lgq0fsv5nx6bid"))))
6670 (build-system cargo-build-system)
6671 (arguments
6672 (list
6673 #:imported-modules (append %copy-build-system-modules
6674 %cargo-build-system-modules)
6675 #:modules '((guix build cargo-build-system)
6676 ((guix build copy-build-system) #:prefix copy:)
6677 (guix build utils))
6678 #:install-source? #f
6679 #:phases
6680 #~(modify-phases %standard-phases
6681 (add-after 'install 'install-extras
6682 (lambda args
6683 (apply (assoc-ref copy:%standard-phases 'install)
6684 #:install-plan
6685 '(("completions/dust.bash"
6686 "share/bash-completion/completions/dust")
6687 ("completions/dust.elv"
6688 "share/elvish/lib/dust")
6689 ("completions/dust.fish"
6690 "share/fish/vendor_completions.d/")
6691 ("completions/_dust"
6692 "share/zsh/site-functions/")
6693 ("man-page/dust.1" "share/man/man1/"))
6694 args))))))
6695 (inputs (cargo-inputs 'du-dust))
6696 (home-page "https://github.com/bootandy/dust")
6697 (synopsis "Graphical disk usage analyzer")
6698 (description "This package provides a graphical disk usage analyzer in
6699text mode.")
6700 (license license:asl2.0)))
6701
6702(define-public mactelnet
6703 (package
6704 (name "mactelnet")
6705 (version "0.4.4")
6706 (source (origin
6707 (method git-fetch)
6708 (uri (git-reference
6709 (url "https://github.com/haakonnessjoen/MAC-Telnet")
6710 (commit (string-append "v" version))))
6711 (file-name (git-file-name name version))
6712 (sha256
6713 (base32
6714 "1z63dz22crrvrm0sh2cwpyqb7wqd9m45m6f2641mwmyp6hcpf4k4"))
6715 (patches (search-patches "mactelnet-remove-init.patch"))
6716 (modules '((guix build utils)))
6717 (snippet
6718 #~(begin
6719 (delete-file "src/utlist.h")
6720 (substitute* (find-files "src/" "\\.c$")
6721 (("\"utlist\\.h\"") "<utlist.h>"))))))
6722 (build-system gnu-build-system)
6723 (arguments
6724 (list
6725 #:tests? #f)) ; no tests
6726 (native-inputs (list autoconf automake gettext-minimal))
6727 (inputs (list uthash))
6728 (synopsis "MAC-Telnet utilities for communicating with RouterOS devices")
6729 (description "This package provides an implementation of the MAC-Telnet protocol
6730used by RouterOS devices. It provides the following commands:
6731@table @command
6732@item{macping}
6733Ping RouterOS devices or @command{mactelnetd} hosts.
6734@item{mactelnetd}
6735MAC-Telnet daemon.
6736@item{mactelnet}
6737MAC-Telnet client.
6738@item{mndp}
6739Discover other RouterOS devices or @command{mactelnetd} hosts.
6740@end table")
6741 (home-page "https://lunatic.no/2010/10/routeros-mac-telnet-application-for-linux-users/")
6742 (license
6743 (list license:gpl2+
6744 ;; Note: applies to src/md5.{c,h}
6745 ;; This file is likely to be gone in the next release.
6746 license:zlib))))
6747
6748(define-public bfs
6749 (package
6750 (name "bfs")
6751 (version "4.1.4")
6752 (source (origin
6753 (method git-fetch)
6754 (uri (git-reference
6755 (url "https://github.com/tavianator/bfs")
6756 (commit version)))
6757 (file-name (git-file-name name version))
6758 (sha256
6759 (base32
6760 "08ym2mzms87vipim8q360drabrlhh8nkj1jzidck19mvkvvx0hvs"))))
6761 (build-system gnu-build-system)
6762 (arguments
6763 (list
6764 #:phases
6765 #~(modify-phases %standard-phases
6766 (replace 'configure
6767 (lambda _
6768 ;; bfs uses a custom configure script.
6769 (invoke "./configure"
6770 "--enable-release"
6771 (string-append "CC=" #$(cc-for-target))
6772 (string-append "--prefix=" #$output))))
6773 (add-before 'check 'disable-exec-no-path-test
6774 (lambda _
6775 ;; This test unsets PATH. It then probably cannot find
6776 ;; echo since it's not inside _PATH_STDPATH (?). We
6777 ;; delete the test to disable it.
6778 (delete-file "tests/posix/exec_nopath.sh")))
6779 (add-after 'disable-exec-no-path-test 'set-paths-in-tests
6780 (lambda* (#:key inputs tests? #:allow-other-keys)
6781 (when tests?
6782 (substitute* '("tests/bfs/execdir_path_relative_slash.sh"
6783 "tests/gnu/execdir_self.sh"
6784 "tests/xspawn.c")
6785 (("/bin/sh\\>") (search-input-file inputs "bin/sh")))))))))
6786 (inputs (list acl attr libcap liburing oniguruma))
6787 (synopsis "Breadth-first search for your files")
6788 (description
6789 "Bfs is a variant of the UNIX @command{find} command that operates
6790breadth-first rather than depth-first. It is otherwise compatible with many
6791versions of @command{find}, including POSIX, GNU, and *BSD find.")
6792 (home-page "https://tavianator.com/projects/bfs.html")
6793 (license license:bsd-0)))
6794
6795(define-public rdfind
6796 (package
6797 (name "rdfind")
6798 (version "1.8.0")
6799 (source
6800 (origin
6801 (method url-fetch)
6802 (uri (string-append "https://rdfind.pauldreik.se/" name "-" version
6803 ".tar.gz"))
6804 (sha256
6805 (base32 "0ddgwx9131ba8ym75xnrz2rcy7l1rjdn8yzf6h0xrhic00r0sb8a"))))
6806 (build-system gnu-build-system)
6807 (native-inputs (list which))
6808 (inputs (list nettle))
6809 (arguments
6810 (list
6811 #:phases #~(modify-phases %standard-phases
6812 (add-before 'check 'patch-tests
6813 (lambda _
6814 (substitute* (list "testcases/hardlink_fails.sh"
6815 "testcases/symlinking_action.sh")
6816 (("\"/bin/sh -c\"")
6817 (format #f
6818 "\"~a -c\""
6819 (search-input-file %build-inputs "/bin/sh"))))
6820 (substitute* "testcases/common_funcs.sh"
6821 (("/bin/echo")
6822 (search-input-file %build-inputs "/bin/echo"))))))))
6823 (home-page "https://rdfind.pauldreik.se")
6824 (synopsis "Find duplicate files")
6825 (description
6826 "Rdfind is a command line tool that finds duplicate files based on
6827their content instead of their file names. It is useful for compressing
6828backup directories or just finding duplicate files.")
6829 (license license:gpl2+)))
6830
6831(define-public sshguard
6832 (package
6833 (name "sshguard")
6834 (version "2.5.1")
6835 (source
6836 (origin
6837 (method git-fetch)
6838 (uri (git-reference
6839 (url "https://bitbucket.org/sshguard/sshguard")
6840 (commit (string-append "v" version))))
6841 (file-name (git-file-name name version))
6842 (sha256
6843 (base32 "1wpxvqwk4k40liq6x5ada6zy77mnp319zz1w0cs2wyq3a5ilpnvr"))))
6844 (build-system gnu-build-system)
6845 (native-inputs
6846 (list autoconf automake bison flex python-docutils))
6847 (arguments
6848 (list #:phases
6849 #~(modify-phases %standard-phases
6850 ;; patch sshguard to find configuration through
6851 ;; environment variable
6852 (add-after 'unpack 'patch-sshguard
6853 (lambda _
6854 (substitute* "src/sshguard.in"
6855 (("^config=.*$")
6856 "config=${SSHGUARD_CONFIG_FILE:-@sysconfdir@/sshguard.conf}\n")))))))
6857 (home-page "https://sshguard.net/")
6858 (synopsis "Daemon to blocks SSH brute-force attacks")
6859 (description
6860 "SSHGuard protects hosts from brute-force attacks against SSH and other
6861services. It aggregates system logs and blocks repeat offenders using one of
6862several firewall backends.")
6863 (license license:isc)))
6864
6865(define-public px
6866 (package
6867 (name "px")
6868 (version "3.6.12")
6869 (source
6870 (origin
6871 (method git-fetch)
6872 (uri (git-reference
6873 (url "https://github.com/walles/px")
6874 (commit version)))
6875 (file-name (git-file-name name version))
6876 (sha256
6877 (base32 "06jg6izya1k5gk71pygv8691fcaa6zfnzns57fjknnihz3c42pzw"))))
6878 (build-system pyproject-build-system)
6879 (arguments
6880 (list
6881 #:test-flags
6882 ;; Tests requiring networking setup or root access.
6883 #~(list "-k" (string-join
6884 (list "not test_get_all_defaultlocale"
6885 "test_get_all_swedish"
6886 "test_match"
6887 "test_ps_line_to_process_1"
6888 "test_ps_line_to_process_2"
6889 "test_ps_line_to_process_unicode"
6890 "test_stdfds_ipc_and_network"
6891 "test_str_resolve"
6892 "test_to_screen_lines_unbounded"
6893 "test_to_screen_lines_unicode")
6894 " and not "))
6895 #:phases
6896 #~(modify-phases %standard-phases
6897 (add-after 'unpack 'patch-git
6898 (lambda* (#:key inputs #:allow-other-keys)
6899 (substitute* (find-files "px" "\\.py$")
6900 ;; We don't have MacOS X programs.
6901 (("px_exec_util[.]run[(]\\[\"(vm_stat)\"" all x)
6902 (string-append "px_exec_util.run([\""
6903 "/bin/false"
6904 "\""))
6905 ;; Patch names of executables in "sbin".
6906 (("px_exec_util[.]run[(]\\[\"(sysctl)\"" all x)
6907 (string-append "px_exec_util.run([\""
6908 (search-input-file inputs
6909 (string-append "sbin/" x))
6910 "\""))
6911 ;; Patch names of executables in "bin".
6912 (("px_exec_util[.]run[(]\\[\"([^/\"]*)\"" all x)
6913 (string-append "px_exec_util.run([\""
6914 (search-input-file inputs
6915 (string-append "bin/" x))
6916 "\"")))
6917 (substitute* "px/px_process.py"
6918 ;; Patch path name of "ps" executable.
6919 (("\"/bin/ps\"") (string-append "\""
6920 (assoc-ref inputs "procps")
6921 "/bin/ps\"")))
6922 (substitute* "setup.py"
6923 ;; Patch "git describe", replacing it by its result.
6924 (("\\[\"git\", \"describe\", \"--dirty\"\\]")
6925 (string-append "[\"echo\", \"" #$version "\"]"))))))))
6926 (native-inputs
6927 (list pkg-config
6928 python-setuptools
6929 python-wheel
6930 python-pytest
6931 python-dateutil))
6932 (inputs
6933 (list lsof
6934 net-tools
6935 procps
6936 sysstat
6937 util-linux))
6938 (home-page "https://github.com/walles/px")
6939 (synopsis "Alternative to @command{ps}, @command{top} and @command{pstree}")
6940 (description
6941 "This package provides a way to figure out which processes communicate
6942with which other processes. It provides more usable versions of @command{ps},
6943@command{top} and @command{pstree}.")
6944 (license license:expat)))
6945
6946(define-public witr
6947 (package
6948 (name "witr")
6949 (version "0.3.3")
6950 (source
6951 (origin
6952 (method git-fetch)
6953 (uri (git-reference
6954 (url "https://github.com/pranshuparmar/witr")
6955 (commit (string-append "v" version))))
6956 (file-name (git-file-name name version))
6957 (sha256
6958 (base32 "0c995b1c267sngg21546n60pqh09vc2pm6xbdy48kx5fwmi01w4h"))))
6959 (build-system go-build-system)
6960 (arguments
6961 (list
6962 #:install-source? #f
6963 #:import-path "github.com/pranshuparmar/witr/cmd/witr"
6964 #:unpack-path "github.com/pranshuparmar/witr"
6965 #:build-flags #~(list "-ldflags"
6966 (string-append "-X main.version=" #$version))))
6967 (home-page "https://github.com/pranshuparmar/witr")
6968 (synopsis "Utility to show why the process is running")
6969 (description
6970 "The @dfn{witr} (why-is-this-running), is a utility to show:
6971@enumerate
6972@item What is running?
6973@item How did it start?
6974@item What is keeping it running?
6975@item What context does it belong to?
6976@end enumerate
6977It shows which process uses the port, and its information like process tree,
6978working directory, user, pid, command, and so on.")
6979 (license license:asl2.0)))
6980
6981(define-public radius
6982 (package
6983 (name "radius")
6984 (version "1.7")
6985 (source
6986 (origin
6987 (method url-fetch)
6988 (uri (string-append "mirror://gnu/radius/radius-" version ".tar.xz"))
6989 (sha256
6990 (base32 "0n9k30ma7n9xmjwlvsv9x333g52lfplbpzcyg0vh2wmm423bvy36"))))
6991 (build-system gnu-build-system)
6992 (arguments
6993 (list
6994 #:configure-flags
6995 #~(list "--with-log-dir=/var/log"
6996 #$@(if (target-hurd?)
6997 '()
6998 '("--with-libpam")))
6999 #:phases
7000 #~(modify-phases %standard-phases
7001 (add-before 'check 'skip-failing-tests
7002 (lambda _
7003 (for-each (lambda (test)
7004 (substitute* "tests/testsuite.at"
7005 ((test)
7006 "")))
7007 (list "execwait")))))))
7008 (inputs (append (if (target-hurd?)
7009 '()
7010 (list linux-pam util-linux))
7011 (list acl
7012 gawk
7013 gdbm
7014 gettext-minimal
7015 guile-3.0
7016 libxcrypt
7017 readline)))
7018 (native-inputs (list autoconf
7019 bash-minimal
7020 bison
7021 flex
7022 groff
7023 m4
7024 procps
7025 texinfo))
7026 (home-page "https://www.gnu.org/software/radius/")
7027 (synopsis "Authentication and accounting services and daemon")
7028 (description
7029 "GNU Radius is a server for remote user authentication and accounting. It
7030is generally useful for networks that require a centralized authentication
7031and accounting services for its workstations. Authentication can be
7032performed in a variety of ways, such as via @file{/etc/passwd} or credentials
7033stored in an SQL database.")
7034 (license license:gpl3+)))
7035
7036(define-public xfel
7037 (package
7038 (name "xfel")
7039 (version "1.3.6")
7040 (source
7041 (origin
7042 (method git-fetch)
7043 (uri (git-reference
7044 (url "https://github.com/xboot/xfel")
7045 (commit (string-append "v" version))))
7046 (sha256
7047 (base32 "0kl5cjjrlzj9kr4ksdczgfja1lv88jgpnk8drm763chy94iqczxl"))
7048 (file-name (git-file-name name version))))
7049 (native-inputs
7050 (list pkg-config))
7051 (inputs
7052 (list libusb))
7053 (build-system gnu-build-system)
7054 (arguments
7055 (list #:tests? #f ; No tests exist
7056 #:make-flags #~(list "PREFIX="
7057 (string-append "DESTDIR=" #$output))
7058 #:phases
7059 #~(modify-phases %standard-phases
7060 (delete 'configure)
7061 (add-after 'unpack 'patch-makefile
7062 (lambda _
7063 (substitute* "Makefile"
7064 (("/usr/local")
7065 #$output)
7066 (("/usr/share")
7067 (string-append #$output "/share/"))
7068 (("/etc/udev/rules.d")
7069 (string-append #$output "/lib/udev/rules.d"))))))))
7070 (home-page "https://github.com/xboot/xfel")
7071 (synopsis "Remote debugging tool for Allwinner devices")
7072 (description "This package contains a debugging tool for Allwinner devices
7073(connects via USB OTG).")
7074 (license license:expat)))
7075
7076(define-public yoctofetch
7077 (package
7078 (name "yoctofetch")
7079 (version "2.0.0")
7080 (source
7081 (origin
7082 (method git-fetch)
7083 (uri (git-reference
7084 (url "https://codeberg.org/Phosphenius/yoctofetch.git")
7085 (commit (string-append "v" version))))
7086 (file-name (git-file-name name version))
7087 (sha256
7088 (base32 "0smkaydv74p2231gafibvqbwsy469w56hya8gz8wq0gw7m2l7zh3"))))
7089 ; Support for other platforms not available per upstream:
7090 ; https://codeberg.org/Phosphenius/yoctofetch#supported-platforms
7091 (supported-systems '("x86_64-linux" "aarch64-linux"))
7092 (build-system gnu-build-system)
7093 (arguments
7094 (list
7095 #:tests? #f)) ; No tests available.
7096 (home-page "https://codeberg.org/Phosphenius/yoctofetch")
7097 (synopsis "Fast and low footprint system fetch tool for the Linux UAPI")
7098 (description
7099 "This package provides a system fetch tool, similar to
7100@command{neofetch}, @command{fastfetch}, etc. It is lightweight and
7101has a focus on performance. It can be used as a greeter by starting
7102it from @file{~/.bashrc} for example.")
7103 (license license:agpl3+)))
7104
7105(define-public zeptofetch
7106 (package
7107 (name "zeptofetch")
7108 (version "2.1")
7109 (source
7110 (origin
7111 (method git-fetch)
7112 (uri (git-reference
7113 (url "https://gitlab.archlinux.org/gurov/zeptofetch")
7114 (commit (string-append "v" version))))
7115 (file-name (git-file-name name version))
7116 (sha256
7117 (base32 "0fg8c5lsvcjspwb64c8hax80i3h0nq1jswf93n3vdgf48l76jpyh"))))
7118 (build-system gnu-build-system)
7119 (arguments
7120 (list
7121 #:tests? #f ; No tests available.
7122 #:make-flags
7123 #~(list (string-append "PREFIX=" #$output)
7124 (string-append "CC=" #$(cc-for-target)))
7125 #:phases
7126 #~(modify-phases %standard-phases
7127 (delete 'configure)))) ; No configure script.
7128 (home-page "https://gitlab.archlinux.org/gurov/zeptofetch")
7129 (synopsis
7130 "Fast, minimal system information tool for Linux")
7131 (description
7132 "This package provides a system fetch tool, similar to
7133@command{neofetch}, @command{fastfetch}, etc. It is lightweight and
7134has a focus on performance.")
7135 (license license:gpl3+)))
7136
7137(define-public zzz
7138 (package
7139 (name "zzz")
7140 (version "20250212")
7141 (source
7142 (origin
7143 (method git-fetch)
7144 (uri (git-reference
7145 (url "https://github.com/void-linux/void-runit")
7146 (commit version)))
7147 (file-name (git-file-name name version))
7148 (sha256
7149 (base32
7150 "00nbnjmxwvqj5hf0g00ma26hb29i9mr05g8ls24icp1409c2ykkc"))))
7151 (build-system copy-build-system)
7152 (arguments
7153 (list #:install-plan
7154 #~'(("zzz" "sbin/")
7155 ("zzz.8" "share/man/man8/"))
7156 #:phases
7157 #~(modify-phases %standard-phases
7158 (add-after 'unpack 'patch-zzz
7159 (lambda* (#:key inputs #:allow-other-keys)
7160 (substitute* "zzz"
7161 (("flock") (search-input-file inputs "bin/flock"))
7162 (("grep") (search-input-file inputs "bin/grep"))))))))
7163 (inputs
7164 (list grep util-linux))
7165 (home-page "https://github.com/void-linux/void-runit")
7166 (synopsis "Simple script to suspend or hibernate your computer")
7167 (description "Simple script to suspend or hibernate your computer. It
7168supports hooks before and after suspending.")
7169 (license license:cc0)))