more guix laptop configs

This commit is contained in:
Ian Keane 2023-11-07 10:40:49 -05:00
parent 1a680f82e6
commit 4f592c0559
3 changed files with 243 additions and 8 deletions

View file

@ -9,14 +9,21 @@
;; Indicate which modules to import to access the variables
;; used in this configuration.
(use-modules (gnu))
(use-modules (gnu packages xorg))
(use-modules (gnu)
(gnu packages xorg)
(gnu packages shells)
(gnu packages linux)
(gnu packages networking)
(gnu packages glib)
(gnu services dbus))
(use-service-modules cups desktop networking ssh xorg)
(use-package-modules audio)
(operating-system
(locale "en_US.utf8")
(timezone "America/New_York")
(keyboard-layout (keyboard-layout "us"))
(keyboard-layout (keyboard-layout "us"
#:options '("ctrl:nocaps"))) ; swapcaps to swap
(host-name "x220")
;; The list of user accounts ('root' is implicit).
@ -24,8 +31,9 @@
(name "green")
(comment "Green")
(group "users")
(shell (file-append fish "/bin/fish"))
(home-directory "/home/green")
(supplementary-groups '("wheel" "netdev" "audio" "video")))
(supplementary-groups '("wheel" "netdev" "audio" "video" )))
%base-user-accounts))
;; Packages installed system-wide. Users can also install packages
@ -37,7 +45,13 @@
(specification->package "nss-certs")
xorg-server
xinit
setxkbmap)
setxkbmap
fish
pipewire
wireplumber
blueman
bluez
dbus)
%base-packages))
;; Below is the list of system services. To search for available
@ -48,18 +62,22 @@
(service ntp-service-type)
(service gpm-service-type)
(service slim-service-type)
(service bluetooth-service-type)
(service dbus-root-service-type)
(service cups-service-type))
;; This is the default list of services we
;; are appending to.
%base-services))
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list "/boot/efi"))
(keyboard-layout keyboard-layout)))
(mapped-devices (list (mapped-device
(source (uuid
"c17293fe-4c21-4425-b74a-f074c6f011d2"))
"2eeecbe8-d213-4773-a431-15757915ee39"))
(target "cryptroot")
(type luks-device-mapping))))
@ -68,7 +86,7 @@
;; by running 'blkid' in a terminal.
(file-systems (cons* (file-system
(mount-point "/boot/efi")
(device (uuid "9324-790E"
(device (uuid "0A77-ACFA"
'fat32))
(type "vfat"))
(file-system

192
guix/init.el Normal file
View file

@ -0,0 +1,192 @@
(setq inhibit-startup-message t)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(load-theme 'tango-dark t)
(recentf-mode 1)
(savehist-mode 1) ; remember previous commands in minibuffer
(save-place-mode 1) ; put cursor in last place when opening a file
;; Avoid customization UI auto-variables in init.el
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
(load custom-file 'noerror 'nomessage)
;; Don't show popup UI when prompting
(setq use-dialog-box nil)
;; Update files when changed on disk
(global-auto-revert-mode 1)
(set-frame-font "DejaVu Sans Mono 12")
;; Initialize Package Sources
(require 'package)
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
;; Persist history over Emacs restarts. Vertico sorts by history position.
(use-package savehist
:init
(savehist-mode))
;; Enable vertico
(use-package vertico
:init
(vertico-mode)
;; Different scroll margin
;; (setq vertico-scroll-margin 0)
;; Show more candidates
;; (setq vertico-count 20)
;; Grow and shrink the Vertico minibuffer
;; (setq vertico-resize t)
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
;; (setq vertico-cycle t)
)
;; A few more useful configurations...
(use-package emacs
:init
;; Add prompt indicator to `completing-read-multiple'.
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Do not allow the cursor in the minibuffer prompt
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
;; Vertico commands are hidden in normal buffers.
;; (setq read-extended-command-predicate
;; #'command-completion-default-include-p)
;; Enable recursive minibuffers
(setq enable-recursive-minibuffers t))
;; A few more useful configurations...
(use-package emacs
:init
;; Add prompt indicator to `completing-read-multiple'.
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Do not allow the cursor in the minibuffer prompt
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
;; Vertico commands are hidden in normal buffers.
;; (setq read-extended-command-predicate
;; #'command-completion-default-include-p)
;; Enable recursive minibuffers
(setq enable-recursive-minibuffers t))
;; todo: evaluate this
;; Optionally use the `orderless' completion style.
(use-package orderless
:init
;; Configure a custom style dispatcher (see the Consult wiki)
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
;; orderless-component-separator #'orderless-escapable-split-on-space)
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(setq completion-styles '(basic substring partial-completion flex))
;; Enable rich annotations using the Marginalia package
(use-package marginalia
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
;; available in the *Completions* buffer, add it to the
;; `completion-list-mode-map'.
:bind (:map minibuffer-local-map
("M-A" . marginalia-cycle))
;; The :init section is always executed.
:init
;; Marginalia must be activated in the :init section of use-package such that
;; the mode gets enabled right away. Note that this forces loading the
;; package.
(marginalia-mode))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages '(counsel ivy)))
(use-package simple-modeline
:hook (after-init . simple-modeline-mode))
(use-package base16-theme)
(global-display-line-numbers-mode t)
(dolist (mode
'(org-mode-hook
term-mode-hook
eshell-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
(column-number-mode)
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package which-key
:init (which-key-mode)
:diminish which-key-mode
:config(setq which-key-idle-delay 0.3))
(use-package helpful)
;; Note that the built-in `describe-function' includes both functions
;; and macros. `helpful-function' is functions only, so we provide
;; `helpful-callable' as a drop-in replacement.
(global-set-key (kbd "C-h f") #'helpful-callable)
(global-set-key (kbd "C-h v") #'helpful-variable)
(global-set-key (kbd "C-h k") #'helpful-key)
(global-set-key (kbd "C-h x") #'helpful-command)
;; Lookup the current symbol at point. C-c C-d is a common keybinding
;; for this in lisp modes.
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
;; Look up *F*unctions (excludes macros).
;;
;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful
;; already links to the manual, if a function is referenced there.
(global-set-key (kbd "C-h F") #'helpful-function)

25
guix/manifest.scm Normal file
View file

@ -0,0 +1,25 @@
(use-modules (gnu packages))
(specifications->manifest
'("vim"
"tmux"
"git"
"bspwm"
"xterm"
"sxhkd"
"ncurses"
"icecat"
"nyxt"
"ungoogled-chromium"
"surf"
"dmenu"
"alacritty"
"fd"
"light"
"emacs"
"xclip"
"xmodmap"
"yt-dlp"
"fontconfig"
"font-bitstream-vera"
"acpi"))