mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 19:45:25 +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
|
(specifications->manifest
|
||||||
'(
|
'(
|
||||||
|
"keepassxc"
|
||||||
"thunar"
|
"thunar"
|
||||||
"xmodmap"
|
"xmodmap"
|
||||||
"copyq"
|
"copyq"
|
||||||
"feh"
|
"feh"
|
||||||
"network-manager-applet"
|
"network-manager-applet"
|
||||||
|
"light"
|
||||||
"arandr"
|
"arandr"
|
||||||
"xrandr"
|
"xrandr"
|
||||||
"flatpak"
|
"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 certs))
|
||||||
(use-modules (gnu packages version-control))
|
(use-modules (gnu packages version-control))
|
||||||
(use-modules (gnu packages vim))
|
(use-modules (gnu packages vim))
|
||||||
|
(use-modules (gnu packages gnome))
|
||||||
|
(use-modules (gnu packages xorg))
|
||||||
(use-modules (gnu packages wm))
|
(use-modules (gnu packages wm))
|
||||||
(use-modules (gnu packages openbox))
|
(use-modules (gnu packages openbox))
|
||||||
(use-modules (nongnu packages linux))
|
(use-modules (nongnu packages linux))
|
||||||
|
|
@ -11,19 +13,20 @@
|
||||||
|
|
||||||
(use-service-modules desktop networking ssh xorg)
|
(use-service-modules desktop networking ssh xorg)
|
||||||
(use-package-modules ssh)
|
(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
|
(operating-system
|
||||||
;; Use the full Linux kernel
|
|
||||||
(kernel linux)
|
(kernel linux)
|
||||||
(initrd microcode-initrd)
|
(initrd microcode-initrd)
|
||||||
(firmware (list linux-firmware))
|
(firmware (list linux-firmware))
|
||||||
(locale "en_US.utf8")
|
(locale "en_US.utf8")
|
||||||
(timezone "Europe/Moscow")
|
(timezone "Europe/Moscow")
|
||||||
|
|
||||||
;; US/RU keyboard layout
|
|
||||||
(keyboard-layout (keyboard-layout "us,ru" #:options '("grp:alt_shift_toggle")))
|
(keyboard-layout (keyboard-layout "us,ru" #:options '("grp:alt_shift_toggle")))
|
||||||
|
|
||||||
;; User accounts
|
|
||||||
(users (cons* (user-account
|
(users (cons* (user-account
|
||||||
(name "pavel")
|
(name "pavel")
|
||||||
(comment "Pavel")
|
(comment "Pavel")
|
||||||
|
|
@ -40,24 +43,15 @@
|
||||||
"lp")))
|
"lp")))
|
||||||
%base-user-accounts))
|
%base-user-accounts))
|
||||||
|
|
||||||
;; Base packages
|
|
||||||
(packages
|
(packages
|
||||||
(append
|
(append
|
||||||
(list nss-certs
|
(list nss-certs
|
||||||
git
|
git
|
||||||
i3-gaps
|
i3-gaps
|
||||||
openbox
|
openbox
|
||||||
|
xterm
|
||||||
vim)
|
vim)
|
||||||
%base-packages))
|
%base-packages))
|
||||||
|
|
||||||
;; Services
|
|
||||||
(services
|
|
||||||
(append
|
|
||||||
(list (service openssh-service-type)
|
|
||||||
(set-xorg-configuration
|
|
||||||
(xorg-configuration
|
|
||||||
(keyboard-layout keyboard-layout))))
|
|
||||||
%desktop-services))
|
|
||||||
(host-name "blue")
|
(host-name "blue")
|
||||||
|
|
||||||
(bootloader
|
(bootloader
|
||||||
|
|
|
||||||
|
|
@ -293,10 +293,10 @@ bindsym $mod+semicolon mode "apps"
|
||||||
|
|
||||||
mode "apps" {
|
mode "apps" {
|
||||||
bindsym Escape mode "default"
|
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 v exec vk-messenger; mode default
|
||||||
bindsym s exec slack; mode default;
|
bindsym s exec "flatpak run com.slack.Slack"; mode default;
|
||||||
bindsym d exec discord; mode default;
|
bindsym d exec "flatpak run com.discordapp.Discord"; mode default;
|
||||||
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
||||||
bindsym c exec "copyq toggle"; mode default
|
bindsym c exec "copyq toggle"; mode default
|
||||||
bindsym k exec "keepassxc"; mode default
|
bindsym k exec "keepassxc"; mode default
|
||||||
|
|
@ -326,8 +326,8 @@ bindsym XF86AudioNext exec mpc next
|
||||||
bindsym XF86AudioPrev exec mpc prev
|
bindsym XF86AudioPrev exec mpc prev
|
||||||
|
|
||||||
# Screen brightness
|
# Screen brightness
|
||||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
|
bindsym XF86MonBrightnessUp exec light -A 5
|
||||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
|
bindsym XF86MonBrightnessDown exec light -U 5
|
||||||
# Media controls & brightness:1 ends here
|
# Media controls & brightness:1 ends here
|
||||||
|
|
||||||
# [[file:../../Desktop.org::*Screenshots][Screenshots:1]]
|
# [[file:../../Desktop.org::*Screenshots][Screenshots:1]]
|
||||||
|
|
|
||||||
13
Desktop.org
13
Desktop.org
|
|
@ -541,10 +541,10 @@ bindsym $mod+semicolon mode "apps"
|
||||||
|
|
||||||
mode "apps" {
|
mode "apps" {
|
||||||
bindsym Escape mode "default"
|
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 v exec vk-messenger; mode default
|
||||||
bindsym s exec slack; mode default;
|
bindsym s exec "flatpak run com.slack.Slack"; mode default;
|
||||||
bindsym d exec discord; mode default;
|
bindsym d exec "flatpak run com.discordapp.Discord"; mode default;
|
||||||
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
bindsym m exec "alacritty -e ncmpcpp"; mode default
|
||||||
bindsym c exec "copyq toggle"; mode default
|
bindsym c exec "copyq toggle"; mode default
|
||||||
bindsym k exec "keepassxc"; mode default
|
bindsym k exec "keepassxc"; mode default
|
||||||
|
|
@ -574,8 +574,8 @@ bindsym XF86AudioNext exec mpc next
|
||||||
bindsym XF86AudioPrev exec mpc prev
|
bindsym XF86AudioPrev exec mpc prev
|
||||||
|
|
||||||
# Screen brightness
|
# Screen brightness
|
||||||
bindsym XF86MonBrightnessUp exec xbacklight -inc 5
|
bindsym XF86MonBrightnessUp exec light -A 5
|
||||||
bindsym XF86MonBrightnessDown exec xbacklight -dec 5
|
bindsym XF86MonBrightnessDown exec light -U 5
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Screenshots
|
*** Screenshots
|
||||||
|
|
@ -2058,13 +2058,16 @@ flatpak install --user flathub com.slack.Slack
|
||||||
Other desktop programs I use are listed below.
|
Other desktop programs I use are listed below.
|
||||||
|
|
||||||
| Guix dependency | Description |
|
| Guix dependency | Description |
|
||||||
|
|------------------------+-------------------------------------------|
|
||||||
| xrandr | X11 CLI to RandR |
|
| xrandr | X11 CLI to RandR |
|
||||||
| arandr | GUI to xrandr |
|
| arandr | GUI to xrandr |
|
||||||
|
| light | Control screen brightness |
|
||||||
| network-manager-applet | Applet to manage network connections |
|
| network-manager-applet | Applet to manage network connections |
|
||||||
| feh | Image viewer. Used to set background |
|
| feh | Image viewer. Used to set background |
|
||||||
| copyq | Clipboard manager |
|
| copyq | Clipboard manager |
|
||||||
| xmodmap | Program to modify keybindings on X server |
|
| xmodmap | Program to modify keybindings on X server |
|
||||||
| thunar | My preferred GUI file manager |
|
| thunar | My preferred GUI file manager |
|
||||||
|
| keepassxc | My preferred password manager |
|
||||||
|
|
||||||
#+NAME: packages
|
#+NAME: packages
|
||||||
#+begin_src emacs-lisp :tangle no
|
#+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 certs))
|
||||||
(use-modules (gnu packages version-control))
|
(use-modules (gnu packages version-control))
|
||||||
(use-modules (gnu packages vim))
|
(use-modules (gnu packages vim))
|
||||||
|
(use-modules (gnu packages gnome))
|
||||||
(use-modules (gnu packages xorg))
|
(use-modules (gnu packages xorg))
|
||||||
(use-modules (gnu packages wm))
|
(use-modules (gnu packages wm))
|
||||||
(use-modules (gnu packages openbox))
|
(use-modules (gnu packages openbox))
|
||||||
|
|
@ -213,25 +214,50 @@ Base packages, necessary right after the installation.
|
||||||
%base-packages))
|
%base-packages))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Services. As for now, just extending =%desktop-services=. In future, this part will probably be made specific for each machine.
|
Default services for each machine. Overrides the default =%desktop-services= to add OpenVPN support
|
||||||
#+begin_src scheme :tangle no :noweb-ref system-base
|
#+begin_src scheme :tangle no :noweb-ref system-common
|
||||||
(services
|
(define %my-desktop-services
|
||||||
(append
|
(modify-services %desktop-services
|
||||||
(list (service openssh-service-type)
|
(network-manager-service-type config =>
|
||||||
(set-xorg-configuration
|
(network-manager-configuration (inherit config)
|
||||||
(xorg-configuration
|
(vpn-plugins (list network-manager-openvpn))))))
|
||||||
(keyboard-layout keyboard-layout))))
|
|
||||||
%desktop-services))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** azure
|
** azure
|
||||||
=azure= is a Lenovo Ideapad 330 laptop.
|
=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
|
#+begin_src scheme :noweb yes :tangle ~/.config/guix/systems/azure.scm
|
||||||
<<system-common>>
|
<<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
|
(operating-system
|
||||||
<<system-base>>
|
<<system-base>>
|
||||||
|
|
||||||
(host-name "azure")
|
(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
|
||||||
(bootloader-configuration
|
(bootloader-configuration
|
||||||
|
|
@ -332,6 +358,21 @@ Don't forget to install =JetBrainsMono Nerd Font=.
|
||||||
| Category | Guix dependency |
|
| Category | Guix dependency |
|
||||||
|----------+--------------------|
|
|----------+--------------------|
|
||||||
| browsers | ungoogled-chromium |
|
| 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
|
** Manifests
|
||||||
#+NAME: packages
|
#+NAME: packages
|
||||||
#+begin_src emacs-lisp :tangle no :var category=""
|
#+begin_src emacs-lisp :tangle no :var category=""
|
||||||
|
|
@ -345,20 +386,26 @@ Browsers
|
||||||
<<packages("browsers")>>))
|
<<packages("browsers")>>))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Dev
|
System
|
||||||
#+begin_src scheme :tangle .config/guix/manifests/dev.scm :noweb yes
|
#+begin_src scheme :tangle .config/guix/manifests/system.scm :noweb yes
|
||||||
(specifications->manifest
|
(specifications->manifest
|
||||||
'(
|
'(
|
||||||
<<packages("dev")>>))
|
<<packages("system")>>))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Office
|
||||||
|
#+begin_src scheme :tangle .config/guix/manifests/office.scm :noweb yes
|
||||||
|
(specifications->manifest
|
||||||
|
'(
|
||||||
|
<<packages("office")>>))
|
||||||
|
#+end_src
|
||||||
* Notes on installing software
|
* Notes on installing software
|
||||||
| Category | Guix dependency | Description |
|
| Category | Guix dependency | Description |
|
||||||
|----------+-----------------+----------------------------------------------------|
|
|----------+-----------------+----------------------------------------------------|
|
||||||
| dev | patchelf | A program to modify existsing ELF executables |
|
| system | patchelf | A program to modify existsing ELF executables |
|
||||||
| dev | glibc | A lot of stuff, including ELF interpeter and ~ldd~ |
|
| system | glibc | A lot of stuff, including ELF interpeter and ~ldd~ |
|
||||||
** flatpak
|
** 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
|
** wakatime-cli
|
||||||
| Note | Description |
|
| Note | Description |
|
||||||
|------+-----------------------|
|
|------+-----------------------|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue