GUIX novosti (home, shell)

pbp
Jurij Podgoršek 2024-03-16 17:28:50 +01:00
parent 8678e6b598
commit 39f1e96e7c
9 changed files with 172 additions and 196 deletions

View File

@ -0,0 +1,23 @@
(cons* (channel
(name 'nonguix)
(url "https://gitlab.com/nonguix/nonguix")
;; Enable signature verification:
(introduction
(make-channel-introduction
"897c1a470da759236cc11798f4e0a5f7d4d59fbc"
(openpgp-fingerprint
"2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
;(channel
; (name 'guixrus)
; (url "https://git.sr.ht/~whereiseveryone/guixrus")
; (introduction
; (make-channel-introduction
; "7c67c3a9f299517bfc4ce8235628657898dd26b2"
; (openpgp-fingerprint
; "CD2D 5EAA A98C CB37 DA91 D6B0 5F58 1664 7F8B E551"))))
;(channel
; (name 'kompot)
; ;;(url "https://git.kompot.si/kompot/guix-paketi")
; (url (string-append "file://" (getenv "HOME") "/projekti/guix-paketi"))
; (branch "main"))
%default-channels)

View File

@ -361,9 +361,6 @@ exec mako --default-timeout=5000 --icon-path /usr/share/icons/Numix
# Autotiling https://github.com/nwg-piotr/autotiling
exec ~/bin/autotiling.py
# Rdece, da lahko spim, hvala
exec gammastep -m wayland -l 46.05108:14.50513
# Zagoni programov razporejeni na workspejse
workspace 0:
workspace 1:

View File

@ -54,7 +54,7 @@ export GUILE_SITE_DIR="$HOME/.local/guile/site_dir"
export XDG_CURRENT_DESKTOP=sway
# Guix
export GUIX_PACKAGE_PATH="$HOME/projekti/guix-paketi"
#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"

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

@ -35,7 +35,7 @@ alias sudo='sudo env PATH=$PATH '
alias ag="rg"
alias less="less -R"
alias gitclean="git fetch -p && for branch in \$(git branch -vv | grep ': gone]' | gawk '{print \$1}'); do git branch -D \$branch; echo 'deleted \$branch'; done"
alias gitclean="git fetch -p && for branch in \$\(git branch -vv | grep ': gone]' | gawk '{print \$1}'\); do git branch -D \$branch; echo 'deleted \$branch'; done"
alias sctl="systemctl"
alias ddrush="ddev exec drush"
alias dcomposer="ddev exec composer"

View File

@ -6,18 +6,27 @@
(use-modules (gnu home)
(gnu packages)
(gnu packages xdisorg)
(gnu services)
(guix gexp)
(gnu home services shells))
(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 "crawl-tiles"
(packages (specifications->packages (list "htop"
"emacs-pgtk"
"binutils"
"gcc-toolchain@11"
"icecat-l10n:sl"
"icecat"
"crawl-tiles"
"acpi"
"zynaddsubfx"
"gnome-tweaks"
"papirus-icon-theme"
"gimp"
"supercollider"
"ardour"
@ -43,16 +52,14 @@
"libappindicator"
"snixembed"
"vlc"
"emacs-next-pgtk"
"qpwgraph"
"pamixer"
"element-desktop"
"pavucontrol"
"libreoffice"
"mako"
"firefox"
"alacritty"
"gammastep"
"redshift-wayland"
"i3status"
"rofi-wayland"
"sway"
@ -78,31 +85,41 @@
"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-bash-service-type
(home-bash-configuration
(aliases '(("ag" . "rg")
("dcomposer" . "ddev exec composer")
("ddrush" . "ddev exec drush")
("gitclean" . "git fetch -p && for branch in $(git branch -vv | grep '\\'': gone]'\\'' | gawk '\\''{print $1}'\\''); do git branch -D $branch; echo '\\''deleted $branch'\\''; done")
("grep" . "grep --color=auto")
("kill-element" . "kill $(ps aux | grep element | awk '\\''{print $2;}'\\'')")
("less" . "less -R")
("ll" . "ls -l")
("ls" . "ls --color -C")
("offer-files" . "python3 -m http.server")
("run-gamma" . "pkill -f gammastep; sleep 3; screen -dm -- gammastep -m wayland -l 46.05108:14.50513")
("sctl" . "systemctl")
("sudo" . "sudo env PATH=$PATH ")
("vi" . "vim")
("wxon" . "xhost +local:")))
(bashrc (list (local-file
"/home/g1smo/sredstva/dotfiles/guix/home.scm/.bashrc"
"bashrc")))
(bash-profile (list (local-file
"/home/g1smo/sredstva/dotfiles/guix/home.scm/.bash_profile"
"bash_profile"))))))))
(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

@ -42,6 +42,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