mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-10 19:23:03 +03:00
feat(guix): screen backlight & OpenVPN on azure
This commit is contained in:
parent
07c4551000
commit
0f98e475c1
6 changed files with 185 additions and 40 deletions
|
|
@ -1,10 +1,12 @@
|
|||
(specifications->manifest
|
||||
'(
|
||||
"keepassxc"
|
||||
"thunar"
|
||||
"xmodmap"
|
||||
"copyq"
|
||||
"feh"
|
||||
"network-manager-applet"
|
||||
"light"
|
||||
"arandr"
|
||||
"xrandr"
|
||||
"flatpak"
|
||||
|
|
|
|||
99
.config/guix/systems/azure.scm
Normal file
99
.config/guix/systems/azure.scm
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
;; [[file:../../../Guix.org::*azure][azure:1]]
|
||||
(use-modules (gnu))
|
||||
(use-modules (gnu system nss))
|
||||
(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 (nongnu packages linux))
|
||||
(use-modules (nongnu system linux-initrd))
|
||||
|
||||
(use-service-modules desktop networking ssh xorg)
|
||||
(use-package-modules ssh)
|
||||
(define %my-desktop-services
|
||||
(modify-services %desktop-services
|
||||
(network-manager-service-type config =>
|
||||
(network-manager-configuration (inherit config)
|
||||
(vpn-plugins (list network-manager-openvpn))))))
|
||||
|
||||
|
||||
(define %backlight-udev-rule
|
||||
(udev-rule
|
||||
"90-backlight.rules"
|
||||
(string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
|
||||
"RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\""
|
||||
"\n"
|
||||
"ACTION==\"add\", SUBSYSTEM==\"backlight\", "
|
||||
"RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\"")))
|
||||
|
||||
(operating-system
|
||||
(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"
|
||||
"lp")))
|
||||
%base-user-accounts))
|
||||
|
||||
(packages
|
||||
(append
|
||||
(list nss-certs
|
||||
git
|
||||
i3-gaps
|
||||
openbox
|
||||
xterm
|
||||
vim)
|
||||
%base-packages))
|
||||
|
||||
(host-name "azure")
|
||||
(services (append
|
||||
(list (service openssh-service-type)
|
||||
(set-xorg-configuration
|
||||
(xorg-configuration
|
||||
(keyboard-layout keyboard-layout))))
|
||||
(modify-services %my-desktop-services
|
||||
(elogind-service-type config =>
|
||||
(elogind-configuration (inherit config)
|
||||
(handle-lid-switch-external-power 'suspend)))
|
||||
(udev-service-type config =>
|
||||
(udev-configuration (inherit config)
|
||||
(rules (cons %backlight-udev-rule
|
||||
(udev-configuration-rules config))))))))
|
||||
|
||||
(bootloader
|
||||
(bootloader-configuration
|
||||
(bootloader grub-efi-bootloader)
|
||||
(target "/boot/efi")
|
||||
(keyboard-layout keyboard-layout)))
|
||||
|
||||
(swap-devices
|
||||
(list (uuid "4b2dedb3-b111-4e69-8c05-6daa2b072c76")))
|
||||
|
||||
(file-systems
|
||||
(cons* (file-system
|
||||
(mount-point "/")
|
||||
(device (file-system-label "my-root"))
|
||||
(type "ext4"))
|
||||
(file-system
|
||||
(mount-point "/boot/efi")
|
||||
(device "/dev/sda1")
|
||||
(type "vfat"))
|
||||
%base-file-systems)))
|
||||
;; azure:1 ends here
|
||||
|
|
@ -4,6 +4,8 @@
|
|||
(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 (nongnu packages linux))
|
||||
|
|
@ -11,19 +13,20 @@
|
|||
|
||||
(use-service-modules desktop networking ssh xorg)
|
||||
(use-package-modules ssh)
|
||||
(define %my-desktop-services
|
||||
(modify-services %desktop-services
|
||||
(network-manager-service-type config =>
|
||||
(network-manager-configuration (inherit config)
|
||||
(vpn-plugins (list network-manager-openvpn))))))
|
||||
|
||||
|
||||
(operating-system
|
||||
;; Use the full Linux kernel
|
||||
(kernel linux)
|
||||
(initrd microcode-initrd)
|
||||
(firmware (list linux-firmware))
|
||||
(locale "en_US.utf8")
|
||||
(timezone "Europe/Moscow")
|
||||
|
||||
;; US/RU keyboard layout
|
||||
(keyboard-layout (keyboard-layout "us,ru" #:options '("grp:alt_shift_toggle")))
|
||||
|
||||
;; User accounts
|
||||
(users (cons* (user-account
|
||||
(name "pavel")
|
||||
(comment "Pavel")
|
||||
|
|
@ -40,24 +43,15 @@
|
|||
"lp")))
|
||||
%base-user-accounts))
|
||||
|
||||
;; Base packages
|
||||
(packages
|
||||
(append
|
||||
(list nss-certs
|
||||
git
|
||||
i3-gaps
|
||||
openbox
|
||||
xterm
|
||||
vim)
|
||||
%base-packages))
|
||||
|
||||
;; Services
|
||||
(services
|
||||
(append
|
||||
(list (service openssh-service-type)
|
||||
(set-xorg-configuration
|
||||
(xorg-configuration
|
||||
(keyboard-layout keyboard-layout))))
|
||||
%desktop-services))
|
||||
(host-name "blue")
|
||||
|
||||
(bootloader
|
||||
|
|
|
|||
|
|
@ -293,10 +293,10 @@ bindsym $mod+semicolon mode "apps"
|
|||
|
||||
mode "apps" {
|
||||
bindsym Escape mode "default"
|
||||
bindsym b exec firefox; mode default
|
||||
bindsym b exec "flatpak run org.mozilla.firefox"; mode default
|
||||
bindsym v exec vk-messenger; mode default
|
||||
bindsym s exec slack; mode default;
|
||||
bindsym d exec discord; mode default;
|
||||
bindsym s exec "flatpak run com.slack.Slack"; mode default;
|
||||
bindsym d exec "flatpak run com.discordapp.Discord"; mode default;
|
||||
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
||||
bindsym c exec "copyq toggle"; mode default
|
||||
bindsym k exec "keepassxc"; mode default
|
||||
|
|
@ -326,8 +326,8 @@ bindsym XF86AudioNext exec mpc next
|
|||
bindsym XF86AudioPrev exec mpc prev
|
||||
|
||||
# Screen brightness
|
||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
|
||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
|
||||
bindsym XF86MonBrightnessUp exec light -A 5
|
||||
bindsym XF86MonBrightnessDown exec light -U 5
|
||||
# Media controls & brightness:1 ends here
|
||||
|
||||
# [[file:../../Desktop.org::*Screenshots][Screenshots:1]]
|
||||
|
|
|
|||
13
Desktop.org
13
Desktop.org
|
|
@ -541,10 +541,10 @@ bindsym $mod+semicolon mode "apps"
|
|||
|
||||
mode "apps" {
|
||||
bindsym Escape mode "default"
|
||||
bindsym b exec firefox; mode default
|
||||
bindsym b exec "flatpak run org.mozilla.firefox"; mode default
|
||||
bindsym v exec vk-messenger; mode default
|
||||
bindsym s exec slack; mode default;
|
||||
bindsym d exec discord; mode default;
|
||||
bindsym s exec "flatpak run com.slack.Slack"; mode default;
|
||||
bindsym d exec "flatpak run com.discordapp.Discord"; mode default;
|
||||
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
||||
bindsym c exec "copyq toggle"; mode default
|
||||
bindsym k exec "keepassxc"; mode default
|
||||
|
|
@ -574,8 +574,8 @@ bindsym XF86AudioNext exec mpc next
|
|||
bindsym XF86AudioPrev exec mpc prev
|
||||
|
||||
# Screen brightness
|
||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
|
||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
|
||||
bindsym XF86MonBrightnessUp exec light -A 5
|
||||
bindsym XF86MonBrightnessDown exec light -U 5
|
||||
|
||||
#+end_src
|
||||
*** Screenshots
|
||||
|
|
@ -2058,13 +2058,16 @@ flatpak install --user flathub com.slack.Slack
|
|||
Other desktop programs I use are listed below.
|
||||
|
||||
| Guix dependency | Description |
|
||||
|------------------------+-------------------------------------------|
|
||||
| xrandr | X11 CLI to RandR |
|
||||
| arandr | GUI to xrandr |
|
||||
| light | Control screen brightness |
|
||||
| network-manager-applet | Applet to manage network connections |
|
||||
| feh | Image viewer. Used to set background |
|
||||
| copyq | Clipboard manager |
|
||||
| xmodmap | Program to modify keybindings on X server |
|
||||
| thunar | My preferred GUI file manager |
|
||||
| keepassxc | My preferred password manager |
|
||||
|
||||
#+NAME: packages
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
|
|
|
|||
77
Guix.org
77
Guix.org
|
|
@ -152,6 +152,7 @@ Common modules:
|
|||
(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))
|
||||
|
|
@ -213,25 +214,50 @@ Base packages, necessary right after the installation.
|
|||
%base-packages))
|
||||
#+end_src
|
||||
|
||||
Services. As for now, just extending =%desktop-services=. In future, this part will probably be made specific for each machine.
|
||||
#+begin_src scheme :tangle no :noweb-ref system-base
|
||||
(services
|
||||
(append
|
||||
(list (service openssh-service-type)
|
||||
(set-xorg-configuration
|
||||
(xorg-configuration
|
||||
(keyboard-layout keyboard-layout))))
|
||||
%desktop-services))
|
||||
Default services for each machine. Overrides the default =%desktop-services= to add OpenVPN support
|
||||
#+begin_src scheme :tangle no :noweb-ref system-common
|
||||
(define %my-desktop-services
|
||||
(modify-services %desktop-services
|
||||
(network-manager-service-type config =>
|
||||
(network-manager-configuration (inherit config)
|
||||
(vpn-plugins (list network-manager-openvpn))))))
|
||||
|
||||
#+end_src
|
||||
|
||||
** azure
|
||||
=azure= is a Lenovo Ideapad 330 laptop.
|
||||
|
||||
=%backlight-udev-rule= should enable member of =video= group change the display backlight. See the relevant page at [[https://wiki.archlinux.org/title/Backlight][Arch Wiki]].
|
||||
|
||||
#+begin_src scheme :noweb yes :tangle ~/.config/guix/systems/azure.scm
|
||||
<<system-common>>
|
||||
|
||||
(define %backlight-udev-rule
|
||||
(udev-rule
|
||||
"90-backlight.rules"
|
||||
(string-append "ACTION==\"add\", SUBSYSTEM==\"backlight\", "
|
||||
"RUN+=\"/run/current-system/profile/bin/chgrp video /sys/class/backlight/%k/brightness\""
|
||||
"\n"
|
||||
"ACTION==\"add\", SUBSYSTEM==\"backlight\", "
|
||||
"RUN+=\"/run/current-system/profile/bin/chmod g+w /sys/class/backlight/%k/brightness\"")))
|
||||
|
||||
(operating-system
|
||||
<<system-base>>
|
||||
|
||||
(host-name "azure")
|
||||
(services (append
|
||||
(list (service openssh-service-type)
|
||||
(set-xorg-configuration
|
||||
(xorg-configuration
|
||||
(keyboard-layout keyboard-layout))))
|
||||
(modify-services %my-desktop-services
|
||||
(elogind-service-type config =>
|
||||
(elogind-configuration (inherit config)
|
||||
(handle-lid-switch-external-power 'suspend)))
|
||||
(udev-service-type config =>
|
||||
(udev-configuration (inherit config)
|
||||
(rules (cons %backlight-udev-rule
|
||||
(udev-configuration-rules config))))))))
|
||||
|
||||
(bootloader
|
||||
(bootloader-configuration
|
||||
|
|
@ -332,6 +358,21 @@ Don't forget to install =JetBrainsMono Nerd Font=.
|
|||
| Category | Guix dependency |
|
||||
|----------+--------------------|
|
||||
| browsers | ungoogled-chromium |
|
||||
| browsers | firefox |
|
||||
** Office
|
||||
| Category | Guix dependency |
|
||||
|----------+-----------------|
|
||||
| office | libreoffice |
|
||||
| office | gimp |
|
||||
** LaTeX
|
||||
| Category | Guix dependency |
|
||||
|----------+-----------------|
|
||||
| latex | texlive |
|
||||
** System
|
||||
| Category | Guix dependency |
|
||||
|----------+-------------------------|
|
||||
| system | openvpn |
|
||||
| system | python |
|
||||
** Manifests
|
||||
#+NAME: packages
|
||||
#+begin_src emacs-lisp :tangle no :var category=""
|
||||
|
|
@ -345,20 +386,26 @@ Browsers
|
|||
<<packages("browsers")>>))
|
||||
#+end_src
|
||||
|
||||
Dev
|
||||
#+begin_src scheme :tangle .config/guix/manifests/dev.scm :noweb yes
|
||||
System
|
||||
#+begin_src scheme :tangle .config/guix/manifests/system.scm :noweb yes
|
||||
(specifications->manifest
|
||||
'(
|
||||
<<packages("dev")>>))
|
||||
<<packages("system")>>))
|
||||
#+end_src
|
||||
|
||||
Office
|
||||
#+begin_src scheme :tangle .config/guix/manifests/office.scm :noweb yes
|
||||
(specifications->manifest
|
||||
'(
|
||||
<<packages("office")>>))
|
||||
#+end_src
|
||||
* Notes on installing software
|
||||
| Category | Guix dependency | Description |
|
||||
|----------+-----------------+----------------------------------------------------|
|
||||
| dev | patchelf | A program to modify existsing ELF executables |
|
||||
| dev | glibc | A lot of stuff, including ELF interpeter and ~ldd~ |
|
||||
| system | patchelf | A program to modify existsing ELF executables |
|
||||
| system | glibc | A lot of stuff, including ELF interpeter and ~ldd~ |
|
||||
** flatpak
|
||||
As for now, the easiest way to install most of proprietary software is via flatpak. See the relevant section in [[file:Desktop.org][Desktop.org]].
|
||||
As for now, the easiest way to install most of proprietary software is via flatpak. See the relevant section in [[file:Desktop.org][Desktop.org]] .
|
||||
** wakatime-cli
|
||||
| Note | Description |
|
||||
|------+-----------------------|
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue