summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-11-26 11:05:50 +0200
committerMarc Coquand <marc@mccd.space>2024-11-26 11:05:50 +0200
commitd555a9c6bb8f224ac32f3d26c482fa78d3891511 (patch)
tree4561ba36c2bec9542b58cc0d0b6236a1edeaa61f /os
parentf2267f63134432923e9e7a7ad900532bec6a5bd6 (diff)
downloadguix-d555a9c6bb8f224ac32f3d26c482fa78d3891511.tar.gz
guix-d555a9c6bb8f224ac32f3d26c482fa78d3891511.tar.bz2
guix-d555a9c6bb8f224ac32f3d26c482fa78d3891511.zip
Diffstat (limited to 'os')
-rw-r--r--os/config.scm28
-rwxr-xr-xos/custom/caps-brightness2
-rw-r--r--os/custom/caps-brightness.scm31
3 files changed, 60 insertions, 1 deletions
diff --git a/os/config.scm b/os/config.scm
index 5a1b295..0f491e6 100644
--- a/os/config.scm
+++ b/os/config.scm
@@ -12,6 +12,8 @@
(use-modules (gnu)
(srfi srfi-1)
(nongnu packages linux)
+ (gnu packages haskell-apps)
+ (caps-brightness)
(nongnu system linux-initrd))
(use-service-modules cups desktop networking ssh xorg nix)
(use-package-modules package-management)
@@ -20,6 +22,22 @@
#~(string-append
font-terminus
"/share/consolefonts/ter-132n"))
+(define %sudoers-specification
+ (plain-file "sudoers" "\
+root ALL=(ALL) ALL
+%wheel ALL=(ALL) ALL
+%wheel ALL=(ALL) NOPASSWD: /run/current-system/profile/bin/cpupower
+%wheel ALL=(ALL) NOPASSWD: /run/current-system/profile/bin/umount
+%wheel ALL=(ALL) NOPASSWD: /run/current-system/profile/bin/caps-brightness
+"))
+
+(use-modules
+ (guix gexp)
+ (guix packages)
+ ;; (guix licenses)
+ (guix build-system trivial)
+ (gnu packages bash))
+
(operating-system
@@ -37,7 +55,7 @@
(comment "Marc")
(group "users")
(home-directory "/home/mccd")
- (supplementary-groups '("wheel" "netdev" "audio" "video")))
+ (supplementary-groups '("wheel" "netdev" "audio" "video" "input")))
%base-user-accounts))
;; Packages installed system-wide. Users can also install packages
@@ -46,6 +64,7 @@
(packages (append (list (specification->package "emacs")
(specification->package "emacs-exwm")
(specification->package "nix")
+ (specification->package "caps-brightness")
(specification->package "xf86-input-libinput")
(specification->package "xf86-video-fbdev")
(specification->package "xf86-video-nouveau")
@@ -91,6 +110,11 @@
'("lobste.rs" "lobste.rs")))))
(modify-services %desktop-services
(delete gdm-service-type)
+ (udev-service-type config =>
+ (udev-configuration
+ (inherit config)
+ (rules (cons kmonad
+ (udev-configuration-rules config)))))
(console-font-service-type
conf =>
(map (lambda (tty)
@@ -113,6 +137,8 @@
(target (uuid
"6ee329b8-9475-4675-9c46-b2f68ec97f08")))))
+ (sudoers-file %sudoers-specification)
+
;; The list of file systems that get "mounted". The unique
;; file system identifiers there ("UUIDs") can be obtained
;; by running 'blkid' in a terminal.
diff --git a/os/custom/caps-brightness b/os/custom/caps-brightness
new file mode 100755
index 0000000..4556c33
--- /dev/null
+++ b/os/custom/caps-brightness
@@ -0,0 +1,2 @@
+#!/bin/sh
+setleds -D +caps < /dev/console
diff --git a/os/custom/caps-brightness.scm b/os/custom/caps-brightness.scm
new file mode 100644
index 0000000..dbae748
--- /dev/null
+++ b/os/custom/caps-brightness.scm
@@ -0,0 +1,31 @@
+(define-module (caps-brightness)
+ #:use-module (guix gexp)
+ #:use-module (guix packages)
+ #:use-module (guix build-system trivial)
+ #:use-module (gnu packages bash))
+
+(define-public caps-brightness
+ (let ((script-name "caps-brightness"))
+ (package
+ (name script-name)
+ (version "0.1")
+ (source (local-file "/home/mccd/system/os/custom/caps-brightness"))
+ (build-system trivial-build-system)
+ (arguments
+ `(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+ (let* ((bin-dir (string-append %output "/bin"))
+ (bin-file (string-append bin-dir "/" ,script-name))
+ (bash-bin (string-append (assoc-ref %build-inputs "bash")
+ "/bin")))
+ (mkdir-p bin-dir)
+ (copy-file (assoc-ref %build-inputs "source") bin-file)
+ (patch-shebang bin-file (list bash-bin))
+ (chmod bin-file #o555)))))
+ (inputs `(("bash" ,bash)))
+ (home-page #f)
+ (synopsis "Set capslock brightness to $1")
+ (description "Set capslock brightness to $1")
+ (license #f))))