Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wi11dey committed Mar 3, 2022
0 parents commit 5217b03
Show file tree
Hide file tree
Showing 11 changed files with 499 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
machines/
*~
2 changes: 2 additions & 0 deletions machines/example.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(operating-system
(inherit (load "../os.scm")))
17 changes: 17 additions & 0 deletions manifest.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(specifications->manifest
'("aspell"
"aspell-dict-en"
"dosfstools" ; Contains mkfs.fat.
"emacs-next-pgtk"
"emacs-auctex"
;; "emacs-djvu3"
"emacs-pdf-tools"
"font-dejavu"
"font-google-noto"
"git"
"icecat" ; TODO remove
"parted"
"perl" ; Magit expects Perl to be installed for some operations.
"scrot"
"texlive" ; TODO texlive-optex only
"unzip"))
98 changes: 98 additions & 0 deletions os.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
(add-to-load-path ".") ; TODO Submit patch to restore (current-filename) behavior.
(use-modules (services startx)
(gnu)
(gnu system)
(gnu system nss)
(gnu system keyboard)
(gnu services)
(gnu services networking)
(gnu packages admin)
(gnu packages certs)
(gnu packages xorg)
;; (gnu packages android)
(gnu services xorg)
(gnu packages disk)
(gnu system setuid)
(guix utils)
(guix gexp)
(guix packages)
(ice-9 textual-ports)
(rnrs io ports)
(srfi srfi-1))

(operating-system
(host-name "guix")
(timezone (let ((current (call-with-port (open-input-file "/etc/timezone")
(lambda (tz) (get-line tz))))
(stdout (standard-output-port))) ; In case (current-output-port) has been set to something different.
(put-string stdout (string-append "Timezone"
(if (string-null? current)
": "
(string-append " [default " current "]: "))))
(flush-output-port stdout)
(let ((new (get-line (standard-input-port))))
(if (string-null? new) current new))))
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us" #:options '("altwin:ctrl_alt_win"
"ctrl:rctrl_ralt"
"caps:menu"
"numpad:mac")))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/sda"))
(keyboard-layout keyboard-layout)))
(kernel-arguments '("modprobe.blacklist=pcspkr,snd_pcsp"))
(file-systems (cons* (file-system
(device (file-system-label "guix"))
(mount-point "/")
(type "btrfs"))
%base-file-systems))
(swap-devices (list (swap-space
(target (file-system-label "swap")))))
(users (cons* (user-account
(name "wi11dey")
(comment "Owner")
(group "users")
;; Adding the account to the "wheel" group
;; makes it a sudoer. Adding it to "audio"
;; and "video" allows the user to play sound
;; and access the webcam.
(supplementary-groups '("wheel"
"netdev"
"audio"
"video"
;; "adbusers"
"input")))
%base-user-accounts))
(packages (cons* wpa-supplicant-minimal
nss-certs
%base-packages))
(setuid-programs
(cons* (setuid-program
(program (file-append udevil "/bin/udevil")))
%setuid-programs))
(services (cons* (service startx-service-type
(xorg-configuration
(keyboard-layout keyboard-layout)
(server (package
(inherit xorg-server)
(name "xorg-server-no-dbus")
(arguments
(substitute-keyword-arguments
(package-arguments xorg-server)
((#:configure-flags flags)
`(cons* "--disable-systemd-logind" ,flags))))))
(server-arguments '("-nolisten" "tcp"
"-noreset"))))
;; (udev-rules-service 'android android-udev-rules
;; #:groups '("adbusers"))
(modify-services %base-services
(console-font-service-type
config => (map (lambda (tty+font)
(cons (car tty+font)
"Lat2-Terminus16"))
config))
(guix-service-type
config => (guix-configuration
(inherit config)
(tmpdir "/dev/shm")))))))
50 changes: 50 additions & 0 deletions packages/optex.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(use-modules (gnu packages tex)
(guix packages)
(guix git-download)
(guix build-system texlive)
(guix licenses))

(define-public optex
(package
(name "optex")
(version "1.05")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/olsak/OpTeX.git")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256 "1grfligh8r6sxv7aas12c6f40kpwa1mj41wglfjca1lnmcbpnfml")))
(build-system texlive-build-system)
(outputs '("out" "doc"))
(propagated-inputs (list texlive-bin texlive-kpathsea))
(native-inputs (list texlive-lm))
(license public-domain)
(home-page "https://petr.olsak.net/optex/")
(synopsis "OpTeX is a LuaTeX format based on plain TeX + OPmac macros.")
(description "OpTeX is a modern plain TeX with power from OPmac (fonts selection system, colors, external graphics, references, hyperlinks...) with Unicode fonts. ")
(arguments '(#:tex-engine "luatex"
#:tex-format #f
#:build-targets '("optex.ini")
#:tex-directory "../web2c"
#:phases (modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
(chdir "optex/base") #t))
(add-after 'install 'copy-files
(lambda* (#:key outputs inputs #:allow-other-keys)
(let ((src (string-append (assoc-ref inputs "source")
"/optex/"))
(doc (string-append (assoc-ref outputs "doc")
"/share/texmf-dist/doc/optex/"))
(out (string-append (assoc-ref outputs "out")
"/share/texmf-dist/tex/optex/")))
(mkdir-p doc)
(copy-recursively (string-append src "doc/")
doc)
(mkdir-p out)
(copy-recursively src out)
(delete-file-recursively (string-append out "/doc"))
#t))))))))

optex
66 changes: 66 additions & 0 deletions packages/udevil.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
(define-module (packages udevil)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages acl)
#:use-module (gnu packages glib)
#:use-module (gnu packages linux)
#:use-module (gnu packages pkg-config)
#:use-module (guix base16))

(define-public udevil
(package
(name "udevil")
(version "0.4.4")
(source (origin
(method url-fetch)
(uri (string-append "https://raw.githubusercontent.com/IgnorantGuru/udevil"
"/pkg/" version "/udevil-" version ".tar.xz"))
(sha256 (base16-string->bytevector "ce8c51fd4d589cda7be56e75b42188deeb258c66fc911a9b3a70a3945c157739"))))
(build-system gnu-build-system)
(native-inputs
`(("pkg-config" ,pkg-config)
("intltool" ,intltool)))
(inputs
`(("glib" ,glib)
("eudev" ,eudev)
("util-linux" ,util-linux)
("acl" ,acl)))
(arguments
'(#:configure-flags (list (string-append "--sysconfdir="
(assoc-ref %outputs "out")
"/etc")
(string-append "--with-mount-prog="
(assoc-ref %build-inputs "util-linux")
"/bin/mount")
(string-append "--with-umount-prog="
(assoc-ref %build-inputs "util-linux")
"/bin/umount")
(string-append "--with-losetup-prog="
(assoc-ref %build-inputs "util-linux")
"/sbin/losetup")
(string-append "--with-setfacl-prog="
(assoc-ref %build-inputs "acl")
"/bin/setfacl"))
#:make-flags '("CFLAGS=-DSYSCONFDIR='\"/etc\"'")
#:phases
(modify-phases
%standard-phases
(add-before 'configure 'defer-setuid
(lambda _
;; This hook tries to make the udevil executable setuid-root which has to be done by a service.
(substitute* '("src/Makefile.in")
(("^install-data-hook:")
"install-data-hook-disabled-for-guix:"))
#t))
;; Installation of the executable never happened because it was in noinst_PROGRAMS and was to be installed by the now-disabled install-data-hook:
(add-after 'install 'install-udevil
(lambda* (#:key outputs #:allow-other-keys)
(install-file "src/udevil" (string-append (assoc-ref outputs "out") "/bin"))
#t)))))
(synopsis "Mount without password")
(description "udevil is a command line Linux program which mounts and unmounts removable devices without a password, shows device info, and monitors device changes. It can also mount ISO files, nfs://, smb://, ftp://, ssh:// and WebDAV URLs, and tmpfs/ramfs filesystems.")
(home-page "https://ignorantguru.github.io/udevil")
(license license:gpl3+)))
32 changes: 32 additions & 0 deletions packages/wpa-supplicant-priv.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(define-module (packages wpa-spplicant-priv)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (gnu packages admin))

(define-public wpa-supplicant-priv
(package
(inherit wpa-supplicant-minimal)
(name "wpa-supplicant-priv")
(arguments
(substitute-keyword-arguments
(package-arguments wpa-supplicant-minimal)
((#:make-flags flags)
'(list "CC=gcc"
(string-append "BINDIR=" (assoc-ref %outputs "out") "/bin")
(string-append "LIBDIR=" (assoc-ref %outputs "out") "/lib")))
((#:phases phases)
`(modify-phases
,phases
(add-after 'configure 'configure-for-privsep
(lambda _
(let ((port (open-file ".config" "al")))
(display "
CONFIG_PRIVSEP=y\n" port)
(close-port port))
#t))
(add-after 'install 'install-wpa-priv
(lambda* (#:key outputs #:allow-other-keys)
(install-file "wpa_priv"
(string-append (assoc-ref outputs "out")
"/sbin"))
#t))))))))
45 changes: 45 additions & 0 deletions packages/zoom.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
(define-module (packages zoom)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages xorg)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages gcc)
#:use-module (gnu packages glib)
#:use-module (gnu packages gl)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages elf))

(define-public zoom
(package
(name "zoom")
(version "5.9.1.1380")
(source (origin
(method url-fetch)
(uri (string-append "https://cdn.zoom.us/prod/" version "/zoom_x86_64.tar.xz")) ; TODO: match (%current-system)
(sha256
(base32 "1z7msgqjhnhlw8gfzkxva4928zjrgq7djyak3ks3w7pdk3s377dr"))))
(build-system gnu-build-system)
(synopsis "Zoom Client for Linux")
(description "The Zoom Client for Linux allows you to start or join Zoom meetings on Linux.")
(home-page "https://zoom.us")
(license #nil)
(inputs `(("libX11" ,libx11)
("libxfixes" ,libxfixes)
("libxtst" ,libxtst)
("libxrender" ,libxrender)
("gcc:lib" ,gcc "lib")
("xcb-util-image" ,xcb-util-image)
("xcb-util-keysyms" ,xcb-util-keysyms)
("libxkbcommon" ,libxkbcommon)
("libglvnd" ,libglvnd)
("wayland" ,wayland)
("freetype" ,freetype)
("fontconfig" ,fontconfig)
("glib" ,glib)
("dbus" ,dbus)))
(native-inputs `(("patchelf" ,patchelf)))))

zoom
Loading

0 comments on commit 5217b03

Please sign in to comment.