2020-05-19 20:55:28 +02:00
|
|
|
;; To collect the size of a system:
|
2020-06-10 09:40:02 +02:00
|
|
|
;; guix size $(guix system build default.scm)
|
2019-06-06 11:47:41 +02:00
|
|
|
(define-module (default)
|
2020-06-08 14:02:45 +02:00
|
|
|
#:use-module (srfi srfi-1)
|
2020-06-10 09:40:02 +02:00
|
|
|
#:use-module (guix packages) ; For emacs-lucid
|
|
|
|
#:use-module (guix build-system gnu) ; For emacs-lucid
|
|
|
|
#:use-module (guix utils) ; For emacs-lucid
|
2019-01-18 15:28:13 +01:00
|
|
|
#:use-module (gnu)
|
|
|
|
#:use-module (gnu system nss)
|
2020-03-31 14:34:57 +02:00
|
|
|
#:use-module (gnu system mapped-devices))
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2020-03-11 13:16:34 +01:00
|
|
|
(use-service-modules
|
|
|
|
desktop
|
|
|
|
;; For tor
|
|
|
|
networking)
|
|
|
|
|
|
|
|
(use-package-modules
|
|
|
|
certs ; nss-certs
|
|
|
|
linux ; ntfs-3g
|
|
|
|
mtools ; exfat
|
2020-06-08 14:02:45 +02:00
|
|
|
nano ; To remove nano.
|
2020-06-10 09:40:02 +02:00
|
|
|
emacs ; For emacs-lucid
|
2020-06-08 14:02:45 +02:00
|
|
|
emacs-xyz ; EXWM
|
2020-06-10 09:40:02 +02:00
|
|
|
xorg ; For emacs-lucid
|
2020-06-08 14:02:45 +02:00
|
|
|
;; To remove zile:
|
|
|
|
zile)
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2019-10-21 19:05:32 +02:00
|
|
|
(define %ambrevar/cdemu-vhba-udev-rule
|
2019-06-06 11:42:49 +02:00
|
|
|
;; For the "uaccess" tag to be applied properly, the rule must be executed
|
|
|
|
;; before the uaccess rule
|
|
|
|
;; (/run/current-system/profile/lib/udev/rules.d/70-uaccess.rules).
|
|
|
|
(udev-rule
|
|
|
|
"69-cdemu-vhba.rules"
|
|
|
|
(string-append "KERNEL==\"vhba_ctl\", SUBSYSTEM==\"misc\", TAG+=\"uaccess\"")))
|
|
|
|
|
2019-01-18 15:28:13 +01:00
|
|
|
;; Mount Nitrokey
|
|
|
|
;; TODO: Check if plugdev works instead of users. If not, report to Nitrokey.
|
|
|
|
;; https://www.nitrokey.com/sites/default/files/41-nitrokey.rules
|
2019-10-21 19:05:32 +02:00
|
|
|
(define %nitrokey-udev-rule
|
|
|
|
(udev-rule
|
|
|
|
"41-nitrokey.rules"
|
|
|
|
(string-append "ACTION==\"add\", SUBSYSTEM==\"usb\", "
|
|
|
|
"ATTR{idVendor}==\"20a0\", ATTR{idProduct}==\"4211\", "
|
|
|
|
"ENV{ID_SMARTCARD_READER}=\"1\", ENV{ID_SMARTCARD_READER_DRIVER}=\"gnupg\", GROUP+=\"users\", MODE=\"0666\"")))
|
2019-01-18 15:28:13 +01:00
|
|
|
;; (define %nitrokey-udev-rule
|
|
|
|
;; (file->udev-rule
|
|
|
|
;; "41-nitrokey.rules"
|
|
|
|
;; (let ((version "20170910"))
|
|
|
|
;; (origin
|
|
|
|
;; (method url-fetch)
|
|
|
|
;; (uri "https://www.nitrokey.com/sites/default/files/41-nitrokey.rules")
|
|
|
|
;; (sha256
|
|
|
|
;; (base32 "127nghkfd4dl5mkf5xl1mij2ylxhkgg08nlh912xwrrjyjv4y9sa"))))))
|
|
|
|
|
2019-10-21 19:05:32 +02:00
|
|
|
(define-public %ambrevar/tor-config
|
|
|
|
"ExitNodes {se},{nl},{fr},{ee},{no},{dk},{fi}
|
|
|
|
StrictNodes 1")
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2019-10-21 19:05:32 +02:00
|
|
|
(define-public %ambrevar/services
|
|
|
|
(cons*
|
|
|
|
(service tor-service-type
|
|
|
|
(tor-configuration
|
|
|
|
(config-file (plain-file "tor.conf" %ambrevar/tor-config))))
|
|
|
|
;; Use the "desktop" services, which include the X11 log-in service, networking
|
|
|
|
;; with Wicd, and more.
|
2019-01-18 15:28:13 +01:00
|
|
|
(modify-services
|
|
|
|
%desktop-services
|
2020-01-12 15:42:05 +01:00
|
|
|
;; (guix-service-type config =>
|
|
|
|
;; (guix-configuration
|
|
|
|
;; (inherit config)
|
|
|
|
;; ;; Don't clean build deps.
|
|
|
|
;; ;; See (info "(guix) Invoking guix-daemon").
|
|
|
|
;; ;; WARNING: This tends to yield an ever-growing store.
|
|
|
|
;; ;; (extra-options '("--gc-keep-outputs"))
|
|
|
|
;; ;; Specify substitutes manually. Defaults
|
|
|
|
;; ;; should be good enough in most cases.
|
|
|
|
;; (substitute-urls
|
|
|
|
;; (list
|
|
|
|
;; "https://ci.guix.gnu.org"
|
|
|
|
;; "https://gx.bufio.org"))
|
|
|
|
;; (extra-options '("--max-jobs=2"))))
|
2019-01-18 15:28:13 +01:00
|
|
|
(udev-service-type config =>
|
|
|
|
(udev-configuration
|
|
|
|
(inherit config)
|
|
|
|
(rules (append (udev-configuration-rules config)
|
|
|
|
(list ;; %nitrokey-udev-rule
|
2019-10-21 19:05:32 +02:00
|
|
|
%ambrevar/cdemu-vhba-udev-rule))))))))
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2020-06-10 09:40:02 +02:00
|
|
|
(define-public emacs-lucid
|
|
|
|
(package
|
|
|
|
(inherit emacs)
|
|
|
|
(name "emacs-lucid")
|
|
|
|
(synopsis "The Emacs text editor with Lucid support")
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments emacs)
|
|
|
|
((#:configure-flags flags ''())
|
|
|
|
`(cons "--with-x-toolkit=lucid" ,flags))))
|
|
|
|
(inputs
|
|
|
|
`(("libxaw" ,libxaw)
|
|
|
|
,@(package-inputs emacs)))))
|
|
|
|
|
|
|
|
(define-public emacs-lucid-xelb
|
|
|
|
(package
|
|
|
|
(inherit emacs-xelb)
|
|
|
|
(name "emacs-lucid-xelb")
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments emacs-xelb)
|
|
|
|
((#:emacs emacs) `,emacs-lucid)))))
|
|
|
|
|
|
|
|
(define-public emacs-lucid-exwm ; No GTK, but the Slim service drags GTK+ anyways.
|
|
|
|
(package
|
|
|
|
(inherit emacs-exwm)
|
|
|
|
(name "emacs-lucid-exwm")
|
|
|
|
(synopsis "Emacs X window manager (using Lucid toolkit)")
|
|
|
|
(propagated-inputs
|
|
|
|
`(("emacs-lucid-xelb" ,emacs-lucid-xelb)))
|
|
|
|
(arguments
|
|
|
|
(substitute-keyword-arguments (package-arguments emacs-exwm)
|
|
|
|
((#:emacs emacs) `,emacs-lucid)))))
|
|
|
|
|
2020-05-23 16:58:31 +02:00
|
|
|
(define-public %ambrevar/packages
|
|
|
|
(cons* nss-certs ; for HTTPS access
|
|
|
|
;; gvfs ; TODO: For user mounts?
|
|
|
|
ntfs-3g
|
|
|
|
;; exfat-utils ; TODO: Needed for macOS drives? Does not seem to work.
|
|
|
|
fuse-exfat
|
2020-06-10 09:40:02 +02:00
|
|
|
emacs-exwm ; Still needs emacs-exwm / emacs-lucid-exwm installed in a user profile.
|
2020-06-08 10:37:09 +02:00
|
|
|
vhba-module ; For CDEmu.
|
2020-06-08 14:02:45 +02:00
|
|
|
(fold (lambda (package l) (delete package l))
|
|
|
|
%base-packages
|
|
|
|
(list nano zile))))
|
2020-05-23 16:58:31 +02:00
|
|
|
|
2020-03-11 13:16:14 +01:00
|
|
|
(define-public %ambrevar/firmware
|
2020-06-10 08:34:56 +02:00
|
|
|
%base-firmware)
|
2020-03-11 12:54:38 +01:00
|
|
|
|
2020-06-08 10:37:09 +02:00
|
|
|
(define-public %ambrevar/default-os
|
2019-01-18 15:28:13 +01:00
|
|
|
(operating-system
|
2019-10-21 19:05:32 +02:00
|
|
|
(host-name "ambrevar-system")
|
2019-01-18 15:28:13 +01:00
|
|
|
(timezone "Europe/Paris")
|
|
|
|
(locale "en_US.utf8")
|
|
|
|
|
|
|
|
;; Use the UEFI variant of GRUB with the EFI System
|
|
|
|
;; Partition mounted on /boot/efi.
|
|
|
|
(bootloader (bootloader-configuration
|
|
|
|
(bootloader grub-efi-bootloader)
|
|
|
|
(timeout 1)
|
|
|
|
(target "/boot/efi")))
|
|
|
|
|
2020-03-11 12:54:38 +01:00
|
|
|
(firmware %ambrevar/firmware)
|
2020-03-31 14:34:57 +02:00
|
|
|
;; TODO: Remove all virtio modules?
|
2020-06-08 18:07:03 +02:00
|
|
|
;; (initrd-modules (delete "virtio-rng" %base-initrd-modules))
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2020-06-10 08:34:56 +02:00
|
|
|
(file-systems (cons*
|
|
|
|
(file-system
|
|
|
|
(device (file-system-label "guix"))
|
|
|
|
(mount-point "/")
|
|
|
|
(type "ext4"))
|
|
|
|
%base-file-systems))
|
2019-01-18 15:28:13 +01:00
|
|
|
|
|
|
|
(users (cons* (user-account
|
|
|
|
(name "ambrevar")
|
|
|
|
(group "users")
|
|
|
|
(supplementary-groups '("wheel" "netdev" ; netdev is needed for networking.
|
2020-03-25 09:37:46 +01:00
|
|
|
"kvm" ; For QEMU (and maybe libvirt)
|
2019-10-21 19:05:32 +02:00
|
|
|
;; "plugdev" ; TODO: Needed for nitrokey?
|
|
|
|
"lp" ; TODO: Needed for bluetooth?
|
2019-01-18 15:28:13 +01:00
|
|
|
"video"))
|
2019-10-21 19:05:32 +02:00
|
|
|
;; TODO: Can we default to name?
|
2019-01-18 15:28:13 +01:00
|
|
|
(home-directory "/home/ambrevar"))
|
|
|
|
%base-user-accounts))
|
|
|
|
|
2020-05-23 16:58:31 +02:00
|
|
|
(packages %ambrevar/packages)
|
2019-01-18 15:28:13 +01:00
|
|
|
|
2019-10-21 19:05:32 +02:00
|
|
|
(services %ambrevar/services)
|
2019-01-18 15:28:13 +01:00
|
|
|
|
|
|
|
;; Allow resolution of '.local' host names with mDNS.
|
|
|
|
(name-service-switch %mdns-host-lookup-nss)))
|
2020-06-10 08:34:56 +02:00
|
|
|
|
|
|
|
%ambrevar/default-os
|