GUIX novosti (home, shell)

k0ns
Jurij Podgoršek 2024-03-16 17:28:50 +01:00
parent bf012bcda9
commit 79430b7133
6 changed files with 295 additions and 162 deletions

View File

@ -0,0 +1,69 @@
. /etc/profile
# <3 default editor (za manjse urejanje)
export EDITOR="vim"
export VISUAL="vim"
# Nek Java fix?
export NLS_LANG=American_America.UTF8
# Guile Zadeve
export GUILE_WARN_DEPRECATED="detailed"
# PhantomJS binary location
export PHANTOMJS_BIN=/usr/bin/phantomjs
# emacspeak speech server
export DTK_PROGRAM=espeak
# Rust paketi
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
# User bin
export PATH="$HOME/bin:$PATH"
# Firefox webrender
export MOZ_WEBRENDER=1
# Wayland pls!
export KITTY_ENABLE_WAYLAND=1
export MOZ_ENABLE_WAYLAND=1
#export XDG_SESSION_TYPE=wayland
# Tole bojda ni dobra ideja (pravi wiki!)
#export GDK_BACKEND=wayland
# QT nastavitve
#export QT_QPA_PLATFORMTHEME="qt5ct"
# GTK izgled: sudo apt install qt5-style-plugins
export QT_QPA_PLATFORMTHEME=gtk
export QT_FONT_DPI=95
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $_JAVA_OPTIONS"
export JAVA_FONTS="/usr/share/fonts/TTF"
#export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_FORCE_DPI=physical
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export _JAVA_AWT_WM_NONREPARENTING=1
# Guile
export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/3.0/ccache:/usr/local/lib/guile/3.0/site-ccache"
export GUILE_SITE_DIR="$HOME/.local/guile/site_dir"
# (FULL)Screen share
export XDG_CURRENT_DESKTOP=sway
# Guix
#export GUIX_PACKAGE_PATH="$HOME/projekti/guix-paketi # guix channel!
#export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
#export GUIX_PROFILE="$HOME/.guix-profile"
#export XDG_DATA_DIRS="/usr/local/share:/usr/share:$XDG_DATA_DIRS"
#export XDG_DATA_DIRS="${GUIX_PROFILE}/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS"
#export PATH="$HOME/.config/guix/current/bin:$PATH"
#. "$GUIX_PROFILE/etc/profile"
# Loadamo sway na tty1!
# If running from tty1 start sway
#if [ "$(tty)" = "/dev/tty1" ]; then
# QT_QPA_PLATFORM=wayland-egl SDL_VIDEODRIVER=wayland exec sway
#fi

97
config.scm 100644
View File

@ -0,0 +1,97 @@
;; -*- mode: scheme; -*-
;; This is an operating system configuration template
;; for a "desktop" setup with GNOME and Xfce.
(use-modules (gnu)
(gnu system nss)
(guix utils)
(nongnu packages linux)
(nongnu system linux-initrd)
(srfi srfi-1))
(use-service-modules desktop xorg dns networking)
(use-package-modules bootloaders certs shells ssh version-control emacs vim wm freedesktop xorg fontutils)
(operating-system
(host-name "apnx")
(timezone "Europe/Ljubljana")
(locale "sl_SI.utf8")
;; Use the UEFI variant of GRUB with the EFI System
;; Partition mounted on /boot/efi.
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets '("/boot/efi"))))
(kernel linux)
(initrd microcode-initrd)
(firmware (list linux-firmware))
(file-systems (cons* (file-system
(device "/dev/sda3")
(mount-point "/")
(type "btrfs")
(options "compress"))
(file-system
(device "/dev/sda2")
(mount-point "/boot/efi")
(type "vfat"))
%base-file-systems))
(swap-devices
(list (swap-space (target "/swapfile"))))
(users (cons* (user-account
(name "g1smo")
(comment "Yuri")
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video" "dialout"))
(shell (file-append zsh "/bin/zsh"))
(home-directory "/home/g1smo"))
(user-account
(name "bask")
(comment "Balkan Anarchist Bookfair")
(group "users")
(supplementary-groups '("wheel" "netdev"
"audio" "video" "dialout"))
(home-directory "/home/bask"))
%base-user-accounts))
;; This is where we specify system-wide packages.
(packages (cons* nss-certs ;for HTTPS access
zsh ;Z shell
openssh
git
emacs
vim
bspwm
libinput
xf86-input-libinput
freetype
%base-packages))
;; Add GNOME and/or Xfce---we can choose at the log-in
;; screen with F1. Use the "desktop" services, which
;; include the X11 log-in service, networking with Wicd,
;; and more.
(services (cons* (service xfce-desktop-service-type)
(service gnome-desktop-service-type)
(service dnsmasq-service-type
(dnsmasq-configuration
(cache-size 1500)))
(service network-manager-service-type
(network-manager-configuration
(dns "dnsmasq")))
(service pam-limits-service-type
(list
(pam-limits-entry "@audio" 'both 'rtprio 99)
(pam-limits-entry "@audio" 'both 'memlock 'unlimited)))
(remove
(lambda (service)
(eq? network-manager-service-type (service-kind service)))
%desktop-services)))
;; Allow resolution of '.local' host names with mDNS.
(name-service-switch %mdns-host-lookup-nss))

View File

@ -0,0 +1,125 @@
;; This "home-environment" file can be passed to 'guix home reconfigure'
;; to reproduce the content of your profile. This is "symbolic": it only
;; specifies package names. To reproduce the exact same profile, you also
;; need to capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
(use-modules (gnu home)
(gnu packages)
(gnu packages xdisorg)
(gnu services)
(guix gexp)
(gnu home services shells)
(gnu home services desktop)
(gnu home services pm)
(gnu home services sound))
(home-environment
;; Below is the list of packages that will show up in your
;; Home profile, under ~/.guix-home/profile.
(packages (specifications->packages (list "htop"
"emacs-pgtk"
"binutils"
"gcc-toolchain@11"
"icecat-l10n:sl"
"icecat"
"crawl-tiles"
"acpi"
"zynaddsubfx"
"gnome-tweaks"
"gimp"
"supercollider"
"ardour"
"slurp"
"wireplumber"
"pipewire"
"qjackctl"
"mplayer"
"ffmpeg"
"libcaca"
"kigo"
"lierolibre"
"transmission:gui"
"wine64"
"wine"
"audacity"
"numix-gtk-theme"
"nextcloud-client"
"nyxt"
"icedove-wayland"
"ungoogled-chromium-wayland"
"keepassxc"
"libappindicator"
"snixembed"
"vlc"
"qpwgraph"
"pamixer"
"element-desktop"
"pavucontrol"
"libreoffice"
"mako"
"alacritty"
"redshift-wayland"
"i3status"
"rofi-wayland"
"sway"
"wev"
"grim"
"xjackfreak"
"ncdu"
"bind:utils"
"python-i3ipc"
"python"
"screen"
"bibata-cursor-theme"
"ripgrep"
"brightnessctl"
"foot"
"jack"
"amb-plugins"
"fil-plugins"
"gnugo"
"bsd-games"
"file"
"nmap"
"font-fira-code"
"font-awesome"
"unzip"
"zsh"
"curl")))
;; Below is the list of Home services. To search for available
;; services, run 'guix home search KEYWORD' in a terminal.
(services
(list (service home-zsh-service-type
(home-zsh-configuration
(zshrc (list (local-file
"/home/g1smo/sredstva/dotfiles/.zshrc"
"zshrc")))
(zprofile (list (local-file
"/home/g1smo/sredstva/dotfiles/.profile"
"profile")))))
;; Skrij misko po 4 sekundah ne-premikanja
(service home-unclutter-service-type
(home-unclutter-configuration
(idle-timeout 2)))
;; Rdecenje zaslona @TODO se ne dela :(
(service home-redshift-service-type
(home-redshift-configuration
(redshift redshift-wayland)
(adjustment-method 'wayland)
(location-provider 'manual)
(latitude 46.05108)
(longitude 14.50513)))
;; Pipewire zvok!
;; Dbus je odvisen paket
(service home-dbus-service-type)
(service home-pipewire-service-type)
;; Indikator nizke baterije
(service home-batsignal-service-type)
)))

View File

@ -1,75 +0,0 @@
(define-module (home services mako)
#:use-module (ice-9 match)
#:use-module (gnu home services)
#:use-module (gnu services configuration)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (gnu packages wm)
#:use-module (guix import utils)
#:use-module ((gnu home-services-utils) #:select (maybe-object->string))
#:export (home-mako-service-type
home-mako-configuration))
(define-configuration/no-serialization home-mako-configuration
(package
(package mako)
"mako package to use")
(config
(alist '())
""))
(define (serialize-mako-config config)
(define* (serialize-criteria criteria #:optional (res '()))
(match criteria
((field value)
(format #f "[~a]\n"
(string-join
(cons (format #f "~a=\"~a\"" field value) res))))
((field value . rest)
(serialize-criteria
rest
(cons (format #f "~a=\"~a\"" field value) res)))))
(define (serialize-key key)
(if (list? key)
(serialize-criteria key)
(string-append (maybe-object->string key) "=")))
(define (serialize-val val)
(cond
((or (number? val) (symbol? val)) (maybe-object->string val))
((list? val) (serialize-mako-config val))
(else val)))
(define (serialize-field key val)
(let ((val (serialize-val val))
(key (serialize-key key)))
(list key val)))
(generic-serialize-alist
(lambda args (flatten (interpose args)))
serialize-field
config))
(define (add-mako-configuration config)
(let ((cfg (home-mako-configuration-config config)))
`(("mako/config"
,(apply mixed-text-file
"config"
(serialize-mako-config cfg))))))
(define add-mako-package
(compose list home-mako-configuration-package))
(define home-mako-service-type
(service-type
(name 'home-mako)
(extensions
(list (service-extension
home-xdg-configuration-files-service-type
add-mako-configuration)
(service-extension
home-profile-service-type
add-mako-package)))
(default-value (home-mako-configuration))
(description "")))

View File

@ -1,87 +0,0 @@
(define-module (home services pipewire)
#:use-module (guix gexp)
#:use-module (gnu packages linux)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu home services)
#:use-module (gnu home services shepherd))
(define (home-pipewire-files-service _)
`(("alsa/asoundrc"
,(mixed-text-file
"asoundrc"
#~(string-append
"<"
#$(file-append
pipewire
"/share/alsa/alsa.conf.d/50-pipewire.conf")
">\n<"
#$(file-append
pipewire
"/share/alsa/alsa.conf.d/99-pipewire-default.conf")
">\n"
"
pcm_type.pipewire {
lib " #$(file-append
pipewire
"/lib/alsa-lib/libasound_module_pcm_pipewire.so") "
}
ctl_type.pipewire {
lib " #$(file-append
pipewire
"/lib/alsa-lib/libasound_module_ctl_pipewire.so") "
}
")))))
(define (home-pipewire-shepherd-service _)
(list
(shepherd-service
(requirement '(dbus))
(provision '(pipewire))
(stop #~(make-kill-destructor))
(start #~(make-forkexec-constructor
(list #$(file-append pipewire "/bin/pipewire")))))
(shepherd-service
(requirement '(pipewire))
(provision '(wireplumber))
(stop #~(make-kill-destructor))
(start #~(make-forkexec-constructor
(list #$(file-append wireplumber "/bin/wireplumber")))))
#;
(shepherd-service
(requirement '(pipewire))
(provision '(pipewire-media-session))
(stop #~(make-kill-destructor))
(start #~(make-forkexec-constructor
(list
#$(file-append
pipewire-media-session
"/bin/pipewire-media-session")
"-c"
#$(file-append
pipewire-media-session
"/share/pipewire/media-session.d/media-session.conf")))))
(shepherd-service
(requirement '(pipewire))
(provision '(pipewire-pulse))
(stop #~(make-kill-destructor))
(start #~(make-forkexec-constructor
(list #$(file-append pipewire "/bin/pipewire-pulse")))))))
(define-public home-pipewire-service-type
(service-type
(name 'home-pipewire)
(extensions
(list (service-extension
home-xdg-configuration-files-service-type
home-pipewire-files-service)
(service-extension
home-shepherd-service-type
home-pipewire-shepherd-service)
(service-extension
home-profile-service-type
(const (list pipewire pulseaudio)))))
(default-value #f)
(description "run pipewire and stuff")))

View File

@ -43,6 +43,10 @@ ln -s "$DIR/.config/compton.conf" ~/.config/compton.conf
# redshift (pordeci skrin, X)
ln -s "$DIR/.config/redshift" ~/.config/redshift
# guix (channel z lokalnimi paketi
mkdir ~/.config/guix
ln -s $DIR/.config/guix/channels.scm ~/.config/guix/channels.scm
# i3 block, bolj fensi statusbar (ne uporabljam vec)
ln -s "$DIR/.i3blocks.conf" ~/.i3blocks.conf