From 61bcd318d9db0f2102bfbad8c09713f7702d8063 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Wed, 12 Apr 2023 15:53:27 +0300 Subject: [PATCH] feat: add iris --- .config/guix/manifests/dev.scm | 1 + .config/guix/manifests/emacs.scm | 2 +- .config/guix/systems/azure.scm | 39 +++++---- .config/guix/systems/eminence.scm | 39 +++++---- .config/guix/systems/indigo.scm | 39 +++++---- .config/guix/systems/iris.scm | 137 ++++++++++++++++++++++++++++++ .emacs.d/init.el | 2 +- Desktop.org | 9 ++ Emacs.org | 4 +- Guix.org | 79 +++++++++++++---- bin/polybar.sh | 6 ++ 11 files changed, 293 insertions(+), 64 deletions(-) create mode 100644 .config/guix/systems/iris.scm diff --git a/.config/guix/manifests/dev.scm b/.config/guix/manifests/dev.scm index f169c4e..18515f4 100644 --- a/.config/guix/manifests/dev.scm +++ b/.config/guix/manifests/dev.scm @@ -12,6 +12,7 @@ "libfaketime" "lua" "gcc-toolchain" + "pkg-config" "go" "openjdk:jdk" "node" diff --git a/.config/guix/manifests/emacs.scm b/.config/guix/manifests/emacs.scm index ada5eec..28cf449 100644 --- a/.config/guix/manifests/emacs.scm +++ b/.config/guix/manifests/emacs.scm @@ -7,7 +7,7 @@ "imagemagick" "font-gnu-freefont" "font-gnu-unifont" - "tdlib-1.8.10" + "tdlib-1.8.13" "yt-dlp" "mpv" "rdrview" diff --git a/.config/guix/systems/azure.scm b/.config/guix/systems/azure.scm index bc60b3d..b0794a1 100644 --- a/.config/guix/systems/azure.scm +++ b/.config/guix/systems/azure.scm @@ -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)) diff --git a/.config/guix/systems/eminence.scm b/.config/guix/systems/eminence.scm index 16fb7b3..1d80f9a 100644 --- a/.config/guix/systems/eminence.scm +++ b/.config/guix/systems/eminence.scm @@ -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)) diff --git a/.config/guix/systems/indigo.scm b/.config/guix/systems/indigo.scm index 1c3aedb..f9e4c8d 100644 --- a/.config/guix/systems/indigo.scm +++ b/.config/guix/systems/indigo.scm @@ -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)) diff --git a/.config/guix/systems/iris.scm b/.config/guix/systems/iris.scm new file mode 100644 index 0000000..5525c2f --- /dev/null +++ b/.config/guix/systems/iris.scm @@ -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 diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0b9749e..8fc8b47 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -5695,7 +5695,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) diff --git a/Desktop.org b/Desktop.org index 13abac6..9c7ac24 100644 --- a/Desktop.org +++ b/Desktop.org @@ -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"]="<>" ["eDP-1"]="<>" ["DVI-D-0"]="<>" ["HDMI-A-0"]="<>" + ["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 | | diff --git a/Emacs.org b/Emacs.org index 4c0b4f9..0528e9a 100644 --- a/Emacs.org +++ b/Emacs.org @@ -8013,7 +8013,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 | @@ -8053,7 +8053,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 diff --git a/Guix.org b/Guix.org index d0688ce..fa1a965 100644 --- a/Guix.org +++ b/Guix.org @@ -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 +<> + +(operating-system + <> + + (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. diff --git a/bin/polybar.sh b/bin/polybar.sh index 4c19e53..63073ea 100755 --- a/bin/polybar.sh +++ b/bin/polybar.sh @@ -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