Merge branch 'master' of github.com:SqrtMinusOne/dotfiles

This commit is contained in:
Pavel Korytov 2023-04-17 12:08:31 +03:00
commit c32b8b6c05
11 changed files with 293 additions and 64 deletions

View file

@ -12,6 +12,7 @@
"libfaketime"
"lua"
"gcc-toolchain"
"pkg-config"
"go"
"openjdk:jdk"
"node"

View file

@ -7,7 +7,7 @@
"imagemagick"
"font-gnu-freefont"
"font-gnu-unifont"
"tdlib-1.8.10"
"tdlib-1.8.13"
"yt-dlp"
"mpv"
"rdrview"

View file

@ -42,8 +42,17 @@
config =>
(network-manager-configuration
(inherit config)
(vpn-plugins (list network-manager-openvpn)))))))
(vpn-plugins (list network-manager-openvpn))))
(guix-service-type
config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))
(define %backlight-udev-rule
(udev-rule
@ -56,19 +65,19 @@
(operating-system
(kernel
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "393b8e0405f44835c498d7735a8ae9ff4682b07f"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "4c812db049d5c9f2c438748e180f9486ad221b0a"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "5.15.12"))))
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "213be7ee6676fc4a3db0e3ac9ce5cd79e2ed209e"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "6311493d7a6271bfbc51f4693857f9a12fe9965d"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.2.9"))))
;; (kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))

View file

@ -42,8 +42,17 @@
config =>
(network-manager-configuration
(inherit config)
(vpn-plugins (list network-manager-openvpn)))))))
(vpn-plugins (list network-manager-openvpn))))
(guix-service-type
config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))
(define %backlight-udev-rule
(udev-rule
@ -56,19 +65,19 @@
(operating-system
(kernel
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "393b8e0405f44835c498d7735a8ae9ff4682b07f"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "4c812db049d5c9f2c438748e180f9486ad221b0a"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "5.15.12"))))
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "213be7ee6676fc4a3db0e3ac9ce5cd79e2ed209e"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "6311493d7a6271bfbc51f4693857f9a12fe9965d"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.2.9"))))
;; (kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))

View file

@ -42,24 +42,33 @@
config =>
(network-manager-configuration
(inherit config)
(vpn-plugins (list network-manager-openvpn)))))))
(vpn-plugins (list network-manager-openvpn))))
(guix-service-type
config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))
(operating-system
(kernel
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "393b8e0405f44835c498d7735a8ae9ff4682b07f"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "4c812db049d5c9f2c438748e180f9486ad221b0a"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "5.15.12"))))
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "213be7ee6676fc4a3db0e3ac9ce5cd79e2ed209e"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "6311493d7a6271bfbc51f4693857f9a12fe9965d"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.2.9"))))
;; (kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))

View file

@ -0,0 +1,137 @@
;; [[file:../../../Guix.org::*iris][iris:1]]
(use-modules (gnu))
(use-modules (gnu system nss))
(use-modules (gnu packages bash))
(use-modules ((gnu packages base) #:select (coreutils glibc)))
(use-modules (gnu packages certs))
(use-modules (gnu packages version-control))
(use-modules (gnu packages vim))
(use-modules (gnu packages gnome))
(use-modules (gnu packages xorg))
(use-modules (gnu packages wm))
(use-modules (gnu packages openbox))
(use-modules (gnu services docker))
(use-modules (gnu services cups))
(use-modules (gnu services virtualization))
(use-modules (srfi srfi-1))
(use-modules (guix channels))
(use-modules (guix inferior))
(use-modules (nongnu packages linux))
(use-modules (nongnu system linux-initrd))
(use-service-modules desktop networking ssh xorg nix)
(use-package-modules ssh)
(define %my-base-services
(cons*
(service openssh-service-type)
(screen-locker-service i3lock "i3lock")
(extra-special-file "/lib64/ld-linux-x86-64.so.2" (file-append glibc "/lib/ld-linux-x86-64.so.2"))
(service nix-service-type)
(service cups-service-type
(cups-configuration
(web-interface? #t)))
(service docker-service-type)
(service libvirt-service-type
(libvirt-configuration
(unix-sock-group "libvirt")
(tls-port "16555")))
(service virtlog-service-type)
(bluetooth-service #:auto-enable? #f)
(modify-services %desktop-services
(network-manager-service-type
config =>
(network-manager-configuration
(inherit config)
(vpn-plugins (list network-manager-openvpn))))
(guix-service-type
config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))
(operating-system
(kernel
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "213be7ee6676fc4a3db0e3ac9ce5cd79e2ed209e"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "6311493d7a6271bfbc51f4693857f9a12fe9965d"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.2.9"))))
;; (kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))
(locale "en_US.utf8")
(timezone "Europe/Moscow")
(keyboard-layout (keyboard-layout "us,ru" #:options '("grp:alt_shift_toggle")))
(users (cons* (user-account
(name "pavel")
(comment "Pavel")
(group "users")
(home-directory "/home/pavel")
(supplementary-groups
'("wheel" ;; sudo
"netdev" ;; network devices
"audio"
"video"
"input"
"tty"
"docker"
"scanner"
"libvirt"
"lp")))
%base-user-accounts))
(packages
(append
(list nss-certs
git
i3-gaps
i3lock
openbox
xterm
vim)
%base-packages))
(host-name "iris")
(services (cons*
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)))
%my-base-services))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sdb"))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
"bc284384-ff00-4fbc-abda-1c46f69c0505")))))
(mapped-devices (list (mapped-device
(source (uuid
"21876acb-e05a-4731-8df0-ba5761910ca8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "ext4")
(dependencies mapped-devices))
(file-system
(mount-point "/boot/efi")
(device (uuid "782E-F6D3"
'fat32))
(type "vfat")) %base-file-systems)))
;; iris:1 ends here

View file

@ -5790,7 +5790,7 @@ ENTRY is an instance of `elfeed-entry'."
(interactive)
(setq telega-server-libs-prefix
(string-trim
(shell-command-to-string "guix build tdlib-1.8.10")))
(shell-command-to-string "guix build tdlib-1.8.13")))
(telega-server-build "CC=gcc"))
(add-hook 'telega-load-hook #'telega-mode-line-mode)

View file

@ -95,6 +95,7 @@ Also, Xresources are used to set =Xft= settings. Unfortunately, the DPI setting
(cond ((string-equal hostname "azure") 120)
((string-equal hostname "eminence") 120)
((string-equal hostname "indigo") 120)
((string-equal hostname "iris") 120)
(t 96)))
#+end_src
@ -1896,6 +1897,8 @@ elif [ "$hostname" = "eminence" ]; then
else
TRAY_MONITOR="eDP"
fi
elif [ "$hostname" = "iris"]; then
TRAY_MONITOR="HDMI-1"
else
TRAY_MONITOR="HDMI-A-0"
fi
@ -1906,24 +1909,28 @@ declare -A FONT_SIZES=(
["eDP-1"]="13"
["DVI-D-0"]="13"
["HDMI-A-0"]="13"
["HDMI-1"]="13"
)
declare -A EMOJI_SCALE=(
["eDP"]="9"
["eDP-1"]="9"
["DVI-D-0"]="10"
["HDMI-A-0"]="10"
["HDMI-1"]="10"
)
declare -A BAR_HEIGHT=(
["eDP"]="29"
["eDP-1"]="29"
["DVI-D-0"]="29"
["HDMI-A-0"]="29"
["HDMI-1"]="29"
)
declare -A BLOCKS=(
["eDP"]="<<polybar-generate-modules(monitor="eDP")>>"
["eDP-1"]="<<polybar-generate-modules(monitor="eDP-1")>>"
["DVI-D-0"]="<<polybar-generate-modules(monitor="DVI-D-0")>>"
["HDMI-A-0"]="<<polybar-generate-modules(monitor="HDMI-A-0")>>"
["HDMI-1"]="<<polybar-generate-modules(monitor="HDMI-1")>>"
)
# Geolocation for some modules
@ -1953,6 +1960,7 @@ for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
polybar mybar &
done
#+end_src
** Individual modules
Some of the custom modules below use Org mode noweb to evaluate colors, because it's faster than querying =xrdb= at runtime. I wish I could reference polybar values there, but [[https://github.com/polybar/polybar/issues/615][it looks like this is impossible]].
@ -3356,6 +3364,7 @@ This section generates manifests for various desktop software that I'm using.
| dev | node | |
| dev | openjdk:jdk | |
| dev | go | |
| dev | pkg-config | |
| dev | gcc-toolchain | |
| dev | lua | |
| dev | libfaketime | |

View file

@ -8116,7 +8116,7 @@ Send =/detach= to all servers. Kinda strange that there's no such function alrea
| Guix dependency |
|-------------------|
| tdlib-1.8.10 |
| tdlib-1.8.13 |
| font-gnu-unifont |
| font-gnu-freefont |
@ -8156,7 +8156,7 @@ Building =telega-server= can create problems. It requires the latest version of
(interactive)
(setq telega-server-libs-prefix
(string-trim
(shell-command-to-string "guix build tdlib-1.8.10")))
(shell-command-to-string "guix build tdlib-1.8.13")))
(telega-server-build "CC=gcc"))
#+end_src

View file

@ -208,19 +208,19 @@ Use the full Linux kernel. I hope I'll be able to use Libre kernel somewhere lat
Inferior in the kernel is used to avoid recompilation. It looks like I can pin these to different commits than in my =channels.scm=
#+begin_src scheme :tangle no :noweb-ref system-base
(kernel
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "393b8e0405f44835c498d7735a8ae9ff4682b07f"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "4c812db049d5c9f2c438748e180f9486ad221b0a"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "5.15.12"))))
(let*
((channels
(list (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
(commit "213be7ee6676fc4a3db0e3ac9ce5cd79e2ed209e"))
(channel
(name 'guix)
(url "https://git.savannah.gnu.org/git/guix.git")
(commit "6311493d7a6271bfbc51f4693857f9a12fe9965d"))))
(inferior
(inferior-for-channels channels)))
(first (lookup-inferior-packages inferior "linux" "6.2.9"))))
;; (kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))
@ -298,8 +298,17 @@ Default services for each machine:
config =>
(network-manager-configuration
(inherit config)
(vpn-plugins (list network-manager-openvpn)))))))
(vpn-plugins (list network-manager-openvpn))))
(guix-service-type
config =>
(guix-configuration
(inherit config)
(substitute-urls
(append (list "https://substitutes.nonguix.org")
%default-substitute-urls))
(authorized-keys
(append (list (local-file "./signing-key.pub"))
%default-authorized-guix-keys)))))))
#+end_src
** indigo
@ -454,6 +463,46 @@ Default services for each machine:
%base-file-systems)))
#+end_src
** iris
=iris= is my work machine.
#+begin_src scheme :noweb yes :tangle ~/.config/guix/systems/iris.scm
<<system-common>>
(operating-system
<<system-base>>
(host-name "iris")
(services (cons*
(set-xorg-configuration
(xorg-configuration
(keyboard-layout keyboard-layout)))
%my-base-services))
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets (list "/dev/sdb"))
(keyboard-layout keyboard-layout)))
(swap-devices (list (swap-space
(target (uuid
"bc284384-ff00-4fbc-abda-1c46f69c0505")))))
(mapped-devices (list (mapped-device
(source (uuid
"21876acb-e05a-4731-8df0-ba5761910ca8"))
(target "cryptroot")
(type luks-device-mapping))))
(file-systems (cons* (file-system
(mount-point "/")
(device "/dev/mapper/cryptroot")
(type "ext4")
(dependencies mapped-devices))
(file-system
(mount-point "/boot/efi")
(device (uuid "782E-F6D3"
'fat32))
(type "vfat")) %base-file-systems)))
#+end_src
* System installation
** Preparation
In my case, the provided ISO doesn't work because of the Libre kernel.

View file

@ -10,6 +10,8 @@ elif [ "$hostname" = "eminence" ]; then
else
TRAY_MONITOR="eDP"
fi
elif [ "$hostname" = "iris"]; then
TRAY_MONITOR="HDMI-1"
else
TRAY_MONITOR="HDMI-A-0"
fi
@ -20,24 +22,28 @@ declare -A FONT_SIZES=(
["eDP-1"]="13"
["DVI-D-0"]="13"
["HDMI-A-0"]="13"
["HDMI-1"]="13"
)
declare -A EMOJI_SCALE=(
["eDP"]="9"
["eDP-1"]="9"
["DVI-D-0"]="10"
["HDMI-A-0"]="10"
["HDMI-1"]="10"
)
declare -A BAR_HEIGHT=(
["eDP"]="29"
["eDP-1"]="29"
["DVI-D-0"]="29"
["HDMI-A-0"]="29"
["HDMI-1"]="29"
)
declare -A BLOCKS=(
["eDP"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["eDP-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["DVI-D-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-A-0"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
["HDMI-1"]="glyph-background--light-magenta pulseaudio glyph-light-magenta--magenta mpd glyph-magenta--light-cyan battery glyph-light-cyan--cyan cpu glyph-cyan--light-green ram-memory glyph-light-green--green swap-memory glyph-green--light-red bandwidth openvpn glyph-light-red--red xkeyboard glyph-red--light-yellow weather glyph-light-yellow--yellow sun glyph-yellow--light-blue aw-afk glyph-light-blue--blue date glyph-blue--background "
)
# Geolocation for some modules