Add initial files

keyring
anemofilia 2023-08-04 08:31:31 -03:00
parent b079040f17
commit 08a8033342
8 changed files with 183 additions and 0 deletions

12
home/services.scm Normal file
View File

@ -0,0 +1,12 @@
(use-modules (anemofilia home services)
#:export (use-home-service-modules))
(define service-module-hint
(@@ (gnu) service-module-hint))
(define-syntax-rule (try-use-modules hint modules ...)
((@@ (gnu) try-use-modules) hint modules ...))
(define-syntax-rule (use-home-service-modules module ...)
(try-use-modules service-module-hint
(gnu home services module) ...))

View File

@ -0,0 +1,5 @@
(define-module (anemofilia packages thinkfan)
#:use-modules (gnu packages linux)
#:use-modules (gnu packages linux))

38
packages/fonts.scm Normal file
View File

@ -0,0 +1,38 @@
(define-module (radix packages fonts)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system font)
#:use-module (gnu packages compression)
#:use-module ((guix licenses) #:prefix license:))
(define-public font-meslo-lg
(package
(name "font-meslo-lg")
(version "1.2.1")
(source
(origin
(file-name "font-meslo-lg")
(method url-fetch/zipbomb)
(uri (string-append "https://github.com/andreberg/Meslo-Font/raw/master/"
"dist/v" version "Meslo%20LG%20v" version ".zip"))
(sha256 (base32 "1l08mxlzaz3i5bamnfr49s2k4k23vdm64b8nz2ha33ysimkbgg6h"))))
(build-system font-build-system)
(native-inputs (list unzip))
(home-page "https://github.com/andreberg/Meslo-Font")
(synopsis "Font for dyslexics and high readability")
(description "Meslo LG is a customized version of Apples Menlo-Regular font
(which is a customized Bitstream Vera Sans Mono).")
(license license:silofl1.1)))
(define-public font-meslo-lg-dz
(package
(inherit font-meslo-lg)
(name "font-meslo-lg-dz")
(version (package-version font-meslo-lg))
(source
(origin
(file-name "font-meslo-lg-dz")
(method url-fetch/zipbomb)
(uri (string-append "https://github.com/andreberg/Meslo-Font/raw/master/"
"dist/v" version "Meslo%20LG%20DZ%20v" version ".zip"))
(sha256 (base32 "0lnbkrvcpgz9chnvix79j6fiz36wj6n46brb7b1746182rl1l875"))))))

26
packages/linux.scm Normal file
View File

@ -0,0 +1,26 @@
(define-module (radix packages linux)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (gnu packages linux)
#:export (thinkfan-next))
(define thinkfan-next
(package
(inherit thinkfan)
(arguments
(list #:modules '((guix build cmake-build-system)
(guix build utils)
(srfi srfi-26))
#:tests? #f
#:configure-flags
#|Enable reading temperatures from hard disks via S.M.A.R.T.|#
#~(list "-DUSE_ATASMART:BOOL=ON")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'create-init-scripts
#|Don't even verify for the presence of SystemD or OpenRC|#
(λ _
(substitute* "CMakeLists.txt"
(("pkg_check_modules\\((SYSTEMD|OPENRC).*" _) "")
#|Fix the destinations|#
(("/etc" directory) (string-append #$output directory))))))))))

10
packages/wm.scm Normal file
View File

@ -0,0 +1,10 @@
(define-module (radix packages wm)
#:use-module (gnu packages wm)
#:use-module (guix transformations)
#:export (awesome-next))
(define awesome-next
((options->transformation
`((with-branch . "awesome=master")
(with-git-url . "awesome=https://github.com/awesomeWM/awesome")))
awesome))

55
services/linux.scm Normal file
View File

@ -0,0 +1,55 @@
(define-module (radix services linux)
#:use-module (gnu)
#:use-module (radix packages linux)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (guix gexp)
#:use-module (guix records)
#:export (<thinkfan-configuration>
thinkfan-configuration
make-thinkfan-configuration
thinkfan-configuration?
thinkfan-shepherd-service
thinkfan-service-type))
(define-record-type* <thinkfan-configuration>
thinkfan-configuration make-thinkfan-configuration
thinkfan-configuration?
(requirement thinkfan-configuration-requirement ;list of symbols
(default '(user-processes)))
(pid-file thinkfan-configuration-pid-file ;string
(default "/var/run/thinkfan.pid"))
(config-file thinkfan-configuration-config-file ;#f | file-like
(default #f))
(respawn? thinkfan-configuration-respawn? ;boolean
(default #t))
(extra-options thinkfan-configuration-extra-options ;list of strings
(default '())))
(define (thinkfan-shepherd-service config)
(match-record config <thinkfan-configuration>
(requirement pid-file config-file respawn? extra-options)
(list (shepherd-service
(provision '(thinkfan))
(documentation
"Adjust fan level according to configured temperature limits.")
(requirement requirement)
(start #~(make-forkexec-constructor
(list (string-append #$thinkfan-next "/sbin/thinkfan")
#$@(if config-file
#~((string-append "-c" #$config-file))
#~())
#$@extra-options)
#:pid-file #$pid-file))
(stop #~(make-kill-destructor))
(one-shot? #t)
(respawn? respawn?)))))
(define thinkfan-service-type
(service-type (name 'thinkfan)
(extensions
(list (service-extension shepherd-root-service-type
thinkfan-shepherd-service)))
(default-value (thinkfan-configuration))
(description
"Adjust fan level according to configured temperature limits.")))

15
system/setuid.scm Normal file
View File

@ -0,0 +1,15 @@
(define-module (radix system setuid)
#:use-module (pipe)
#:use-module (ice-9 match)
#:use-module (radix utils)
#:use-module (gnu system setuid)
#:export (map-setuid-programs))
(define-syntax-rule
(map-setuid-programs (package package-programs) clause ...)
(map (match-lambda ((package-program . package)
(setuid-program
(program (->> package-program
(string-append "/bin/")
(file-append package))))))
(associate-right (package package-programs) clause ...)))

22
utils.scm Normal file
View File

@ -0,0 +1,22 @@
(define-module (radix utils)
#:use-module (srfi srfi-26)
#:export (associate-left
associate-right
flatmap))
(define-syntax-rule
(associate-left (key associations) ...)
`(,@(map (cut cons key <>) associations) ...))
(define-syntax-rule
(associate-right (association keys) ...)
`(,@(map (cut cons <> association) keys) ...))
(define (flatmap proc . args)
(if (null? (cdr args))
(map proc (car args))
(apply append
(map (lambda (x) (apply flatmap
(lambda arglist (apply proc x arglist))
(cdr args)))
(car args)))))